folding

Type: Boolean

Availability: Read or write at any time

The folding property of the JadeTextEdit control specifies whether text editor lines can be folded to make them hidden. By default, the value of this property is false; that is, folding is not enabled.

When the value of the folding property is set to true, the fold margin (margin 2) is displayed and lines are marked as fold points (fold marks), based on the hierarchical structure of the editor text and the current language. Fold mark symbols indicate which text lines are fold points and their current stat (that is, contracted or expanded).

As fold point lines are chosen by the lexical analyzer of the current language, they are language-sensitive.

For the JADE language with normal folding, the start of a fold block is tied to the word at the end of the block instruction header (for example, then or do) and the end of a fold block is bound to the line preceding the block instruction trailer (end, endif, endwhile, and so on). With compact folding, the start of the fold block is tied to the first word of the block instruction and the end of the fold block is tied to the line including the instruction trailer.

The character sequences //{ and //} are also recognized as fold block start and end, respectively.

When fold marks are displayed in the margin, clicking the mouse expands a contracted fold mark or contracts an expanded fold block. In addition to showing markers in the fold margin, you can use the foldFlags property to cause the editor to draw a line around a fold point lines using the foreground color of the default text style.

You can use the foldSymbols property to define which symbol set is displayed in the fold margin.

The mouse actions that you can perform within the fold margin of the JadeTextEdit control are listed in the following table.

Mouse Action Result
Ctrl+Shift+left-click Toggles (expands or contracts) all outer (parent) fold points
Shift+left-click Toggles (expands or contracts) the nearest fold point and all lower-level (child) fold points to match
Left-click Toggles (expands or contracts) the nearest fold point