Auto-Indent

Index of All Documentation » Wing Pro Reference Manual » Source Code Editor » Indentation »


Wing auto-indents code as you create new lines with Return, by adding leading white space appropriate for the context. Enough white space is inserted to match the indentation level of the previous line, possibly adding or removing a level of indentation if a block has been started (with if, for, and others) or ended (with return).

Some of the auto-editing operations also result in auto-indentation.

Disabling Auto-Indent

Auto-indent can be disabled with the Editor > Indentation > Auto-indent preference. When disabled, the Tab key may be used to insert indentation, depending on its configuration.

Auto-Indent After Paste

Wing also auto-indents code when pasting multiple lines of Python. If the auto-indent is incorrect, a single Undo will return the pasted text to its original indentation level, or the text can be selected and adjusted with the indentation toolbar, or the Source > Indentation menu items. Auto-indent during Paste can be disabled with the Edit > Clipboard > Adjust Indent After Paste preference.

Wing also converts indentation style during Paste to match the target file. This can be disabled with the Edit > Clipboard > Convert Indent Style On Paste preference.