IDE Window: Editor Options Code Folding

From Free Pascal wiki
Revision as of 22:54, 19 August 2009 by Martin (talk | contribs)
  • You can get this dialog via:
Menu / Environment / Editor options / Code folding
Source editor / popup menu / Options ...


Code folding allows certain structure or blocks of text to be "collapsed". This will hide all but the first line of the block, and the first line will be marked with the folded-symbol "[...]" at the end of that line.

Code folding is done by using a special area in the Gutter which displays the code folding tree. In the tree you will find nodes at the lines were a fold-able region starts.

  • [-] denotes the beginning of a fold-able block, which is not yet folded. This is called an expanded block. Clicking on the [-] Symbol will fold (collapse) this block.
  • [+] denotes the beginning of a fold-able block, which is folded (hidden). This is called an collapsed block. Clicking on the [+] symbol will unfold (expand) this block.
  • | a vertical line is shown in front of lines that belong to a fold-able region, but are not the top line of such a region. The vertical line always begins under the [+] sign and continues to the last line of the block. On the last line it displays a tiny edge.

Fold-able blocks can be nested.

Code folding

The checkbox on top globally enables or disables code folding. If disabled, the Gutter will not display the fold tree neither.

Language specific options

Currently code folding is only supported for Pascal Source

Mark blocks of code and let the user fold them. The checkbox will enable or disable code folding in the editor.