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:
    • End statements (as in IF, END... IF) are not inserted automatically.
    • 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 column matching the indent of the preceding line within the same code area. The Smart edit mode rules for indenting comments in the right-hand area apply.

    With Block 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.

    Smart
    The default option.

    With Smart indenting selected, the IDE attempts to determine the correct indentation for the specific area of code and code construct.

    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.

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