Options|Auto Indent

(available in EditPad Pro only)

Turn on Options|Auto Indent if you want the indentation of the next line to be increased or decreased automatically relative to the previous line whenever you press Enter on the keyboard while in the editor. Auto Indent is only available if the syntax coloring scheme you selected for the file’s file type specifies indentation rules. Those rules may use the indentation style you select on the Brackets page in the file type configuration.

Turning on Auto Indent automatically turns on Options|Keep Indent. If the syntax coloring scheme does not apply any indentation rules to the text on the current line then the new line gets the same amount of indentation when you press Enter.

Auto Indent may change indentation after you enter text on the new line after pressing Enter. The file types for C-style languages included with EditPad Pro, for example, automatically outdent a line with a closing brace by one level. But as you enter your code, that closing brace may not be there yet. So if you have these three lines:

void routine() {
  if (condition) {
    statement;

If you press Enter with the cursor at the third line then the new fourth line is automatically indented by four spaces. There is nothing on the third line that affects indentation. If you enter a } on the fourth line and press Enter or move the cursor away from the line then Auto Indent kicks in and outdents the fourth line by one step, producing the desired result:

void routine() {
  if (condition) {
    statement;
  }

EditPad Pro’s Auto Indent is just a typing aid. It allows you to enter the above example without having to press the Space bar or Backspace key to add or remove any indentation at all. EditPad Pro’s Auto Indent does not analyze your whole file to automatically fix any indentation issues. Auto Indent does not fix the indentation of lines that you paste. When you press Enter, it looks at the contents of the line the cursor is on to determine the indentation level of the next line. When you enter text at the start of a line, it adjusts the indentation of that line when you move the cursor away from the line. It then only looks at the text at the start of that line.

Auto Indent does not interfere if you manually adjust the indentation of a line. In the above example, if you use the Space bar or Backspace key between pressing Enter and typing the } then the } is inserted at the position of the cursor. EditPad assumes that you know where you want the } to be when you manually edit the indentation.

Automatic indentation is always applied to line breaks that are inserted automatically when Options|Auto Break is on. Options|Auto Indent only affects line breaks that you enter manually.

Note that “auto indent” is a file type specific setting in EditPad Pro. If you change the setting through the Options menu or the toolbar, it is applied to the active file only. If you create a new file or open an existing one then EditPad uses the setting you made on the Tabbing page for the type of file you are creating or opening. Also, when you use File|Save As to save the file as a different file type, the setting for the current file changes to what you specified for the new file type.

If you change a file’s “auto indent” setting, EditPad Pro remembers that when you close and reopen the file if you tick “preserve file settings” on the Save Files page in the Preferences.

See Also

Options menu
Options|Keep Indent
File Types|Tabbing
File Types|Colors and Syntax
File Types|Brackets