Configuring the Indentation

You can configure how lines of code are indented in the editor. This also depends on whether you are using Smart edit mode.

  1. In the IDE, click Tools > Options.
  2. Expand Text Editor > Micro Focus COBOL and then click Tabs.
  3. Specify an option in the Indenting section:
    None
    No indentation occurs when you press Enter. In addition:
    • With Smart edit mode disabled, the cursor moves to column 1 at the beginning of the new line.
    • With Smart edit mode enabled, the cursor moves to the new line at the start of the current area. The Smart edit mode rules for indenting comments in the right-hand area apply.
    Block
    • With Smart edit mode disabled, pressing Enter indents the text and positions the cursor on the new line in the same column where the preceding line starts. When you press Enter in the right-hand area, this moves the cursor to the new line in the same column where the preceding line starts - either in the A/B area or in the right-hand area.
    • With Smart edit mode enabled, pressing Enter indents the text and positions the cursor on the new line in the same column where the preceding line starts. Any blank spaces between the cursor and the following text are removed. The Smart edit mode rules for indenting comments in the right-hand area apply.
    Smart
    The default option. Only applies to imperative code (code in the procedure division or in a method) in the A/B area. Indenting in other areas of the program or in other COBOL areas in the editor behaves as when Block is enabled.

    With Smart indenting selected, pressing Enter after an XML documentation comment (which starts with *>>comment) positions the cursor on the new line in the same column where the previous line starts, and starts the line with the tag for an XML documentation comment.

    • With Smart edit mode disabled, pressing Enter in the A/B area or in the right-hand area indents the text and positions the cursor in the same column where the preceding line starts.
    • With Smart edit mode enabled, pressing Enter indents the text and positions the cursor in the same column where the preceding line starts. Any blank spaces after the cursor are removed. The Smart edit mode rules for indenting comments in the right-hand area apply.

For all modes, when you press Enter and create a new line, any blank spaces between the cursor and the following text are removed.