Options, Text Editor

Overview

The Tools > Options > Text editor dialog box allows settings concerning the editing in a text editor. The following tabs are available:

  • Theme

  • Editing

  • Text Area

  • Margin

  • Monitoring

Theme Tab

The Theme tab allows you to set the theme for the ST editor:

Theme

Select the color theme for the text editor from the list. The selected theme is displayed in the Preview window.

Available themes are stored in the Themes folder of the installation directory.

Editing Tab

Definition of undo, tabulator, indenting, folding, and so on, in the Editing tab of the Text editor dialog box

Number of undos

Define how many editing steps should be saved. They can be undone by selecting the Undo function.

Folding

Define whether the code should be viewed as structured by folds. This means that sections specified by indented position or marked by a special comment are hidden in a fold. This fold can be opened or closed via by a mouse-click on the plus- or minus-sign on the left side of the folds header line.

The options:

  • None: No folding is performed.

  • Indent: The lines indented to the previous one are placed in a fold, which is headed by the preceding line.

    Examples: The lines between VAR and END VAR or between IF and END IF are indented, thus are packed in a fold indicated by a minus-sign in open and by the plus-sign in closed state.

  • Explicit: The code section to be packed in a fold must be marked explicitly by comment lines: Before the comment section, enter 3 open brackets {{{, after the comment section, enter 3 closed brackets }}}. The comment may contain additional text also.

Word wrap

  • None: The line can be filled endlessly.

  • Soft: The lines are broken at the boundary of the window.

  • Hard: The lines will be broken after the number of characters defined by Wrap margin. (A value of zero means that the lines are wrapped at the window boundary).

Tab width

Tab width in number of characters.

Keep tabs

If activated: A space which has been entered using the TAB key according to the defined Tab width (see above) will not be resolved to single character spaces afterwards. Therefore, if the tab width is changed later, the existing tab spaces will be corrected so.

Indent width

Indent width used in case of AutoIndent (see below); that is the number of spaces at the beginning of a line.

AutoIndent

  • None: No automatic indenting. Editing always starts at the left margin of the text area of the editor.

  • Block:

  • Smart: Code lines following a keyword (for example, VAR or IF) are automatically indented according to the Indent width defined above.

  • Smart with code completion: When you enter a keyword like for example, VAR or IF, the associated code lines following below are indented according to the Indent width defined above. Additionally, the terminating keyword is added (for example END_VAR or END_IF).

Text Area Tab

Color and font definitions for the editing area of the text editor.

You can activate the following options in the Text area tab of the Text editor dialog box in order to have some visual assistance during editing.

Highlight current line

The line where the cursor is placed, is highlighted with the color defined in the selection list.

Matching brackets

If the cursor is placed before or after a bracket ( or ) in a code line, the corresponding closing or opening bracket will be indicated by a rectangle which is colored as defined in the color selection field. Also, if the cursor is placed in the first or last line of a bracket scope, the corresponding line at the end or start of this scope is indicated also by a rectangle of this color.

End of line markers

The end of each editor line is marked by a small dash (-) of the defined color which is placed behind the last position which is occupied by a character or a white space.

Wrap guide

If a soft or hard word wrap is activated (see tab Editing), the defined wrap margin is indicated by a vertical line in the defined color.

Font

Choose the font to be used in the text editor. Click the sample field to open the standard dialog box for setting the font.

Margin Tab

Definition of colors, font, mouse-click definitions concerning the area left to the editing area of the text editor.

The following options in the Margin tab of the Text editor dialog box concern the left margin of the editor view, which is separated by a vertical line to the editing area

Line numbering

Line numbers are displayed in the declaration and in the implementation part of the view, each starting with the number 1 in the first line.

Highlight current line

Color of the line number of the line that is being edited.

Show bracket scope

A bracket scope contains lines between corresponding keywords, such as between IF and END_IF. You can activate this bracket scope function by option Matching brackets in the tab Text area. If the cursor is placed before, after or within a corresponding keyword, the bracket scope will be indicated by a bracket in the margin area.

Mouse actions

Define which of the following actions should be performed when you execute the associated type of mouse-click on the plus- or minus sign before the header line of a fold.

  • None: No action

  • Select fold: The lines of the fold area are selected.

  • Toggle fold: The first level of the fold is opened or closed.

  • Toggle fold fully: All levels of a fold are opened or closed.

Types of Mouse actions: Click, Shift-Click, Ctrl-Click, Alt-Click

Monitoring Tab

Enable inline monitoring

Activate or deactivate inline monitoring.

Number of displayed digits

Define how many decimal places (digits) should be maximally displayed in case of floating values.

String length

Define the number of characters maximally displayed in case of a string value.

... sample

Preview of the defined monitoring settings.