Dialog Options - Text editor

Function: The dialog contains settings for displaying and working in a text editor.

Call: TwinCAT > PLC programming environment > Text editor

Theme tab

In this tab you set the desired theme for the ST Editor interface design. (Available from Build 4026)

Theme

Color scheme for the text editor. The selected theme is displayed in the Preview window.

Editing tab

Dialog Options - Text editor 1:

Number of undos

Maximum number of steps for which the command Edit > Undo is available.

Folding

Defines the structuring of the code by indentations.

When you select an indentation, you can expand or collapse the indentation section using a plus or minus sign to the left of the first line of each section.

  • Indentation: TwinCAT combines all lines that are indented relative to the previous line in one indentation unit.
  • Explicit: You explicitly use comments to identify the code section to be grouped in an indentation unit: The section must be preceded by a comment containing 3 opening curly brackets "{{{", and followed by a comment containing 3 closing curly brackets "}}}". The comments can contain additional text. Sample:

Dialog Options - Text editor 2:

Dialog Options - Text editor 3:

Word wrap

  • Soft: The line break occurs at the edge of the editor window if 0 is entered for the wrap margin.
  • Hard: The line break occurs after the number of characters specified at the wrap margin.

Tab width

Number of characters

Keep tabs

Dialog Options - Text editor 4:: The space that you have inserted with the [ Tab ] key will not subsequently be converted by TwinCAT into individual spaces.

Indent width

If you have activated Smart or Smart with code completion for the Auto Indent option, TwinCAT inserts the number of spaces at the beginning of the line.

Auto Indent

  • Do not indent automatically
  • Block: A new line automatically adopts the indentation of the previous line.
  • Intelligent: Lines that follow a line containing a keyword (for example, VAR) automatically indent by the specified indent width.
  • Smart with code completion: Indentation as with the Smart option, in addition TwinCAT inserts the final keyword (e.g. END_VAR).

Text area tab

Dialog Options - Text editor 5:

Highlight current line

Dialog Options - Text editor 6:: The line in which the cursor is positioned is highlighted.

Matching brackets

Dialog Options - Text editor 7:: If the cursor is positioned before or after a bracket within a code line, TwinCAT marks the corresponding closing or opening bracket with a frame.

Line markers

Dialog Options - Text editor 8:: TwinCAT marks the end of each editor line with a small horizontal line after the last character of the line (including spaces).

Wrap guide:

Dialog Options - Text editor 9:: If a soft or hard line break is enabled, the defined wrap guide is displayed by a vertical line.

Caret color

Color of the cursor character

Selection color

Color of the selected text area

Inactive

Color of a selection if the corresponding window is not active (focus is on another window).

Folded line foreground

Color of the header line of a closed indented section in the code

Folded line background

Header line of a closed indented section in the code is highlighted in color.

Font

A click on the field opens the standard dialog for configuring the font.

Margin tab

Dialog Options - Text editor 10:

Settings for the left margin of the text editor window, which is separated by a vertical line from the input area:

Line numbering

Dialog Options - Text editor 11:: Display of the line numbers in the declaration and implementation part, each starting with 1

Foreground color

Line number color

Background color

Margin color

Highlight current line

Dialog Options - Text editor 12:: The line number of the line where the cursor is located is highlighted.

Show bracket scope

Dialog Options - Text editor 13::Bracketing comprises the lines between the keywords that open and close a construct, such as IF and END_IF.

If the option is enabled and the cursor is positioned before, after or in one of the keywords of a construct, the bracketing area is indicated by a square bracket in the margin.

Focused border color

Color of the dividing line between the margin and the input area

Unfocused border color

Color of the dividing line between the margin and input area of the currently inactive part of the window

Mouse actions

One of the following actions can be assigned to each of the specified mouse actions or mouse button shortcuts. TwinCAT executes the actions when you execute the mouse action on the plus or minus sign before the header line of a bracketed area:

  • None: The mouse action does not trigger any action.
  • Select fold: TwinCAT selects all the lines of the bracketed area.
  • Toggle fold: TwinCAT opens or closes the bracketed area, or, in case of nested bracketing, the first level of the bracketed area.
  • Toggle fold fully: TwinCAT opens or closes all levels of a nested bracketed area.

Monitoring tab

Dialog Options - Text editor 14:

Settings for displaying the monitoring fields

Enable Inline Monitoring

Dialog Options - Text editor 15:: The monitoring fields are displayed after the variables in online mode

Monitoring foreground color

Representation of the value in the monitoring field

Monitoring background color

Representation of the background in the monitoring field

Flow control foreground color

Representation of the value in the monitoring fields at the flow control items

Flow control background color

Representation of the background of the monitoring fields at the flow control positions

Number of displayed digits

Number of decimal places in the monitoring field

String length

Maximum length of string variable values in the monitoring field

See also: