Indentation Tool

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

The Indentation tool, accessible from the Tools menu, can be used to inspect and change indentation style and size in the current source file.

Indentation Statistics

The top of this tool shows indentation statistics for the current file. This includes the following information:

Status indicates what indentation type is being used for the file.

Counts shows the number of indentations found in the file and how many of those are tab-only, space-only, or tab+space. For example, in a file with 233 space-only indentations and 3 tab-only indentations this would display 236 (3t/233s/0t+s). If the file contains indentation errors or warnings, these can be traversed with the right/left arrow buttons shown to the right of the counts. Pressing these buttons jumps to the problem in the editor and hovering the mouse over the indicated code will show details of the error or warning.

Tab Size shows the effective size of the tab character for this file and the origin of this value, which may be preferences or the contents of the file, depending on indentation preferences, file type, and file contents,

Indent Size shows the indent size being used for this file, along with the origin of this value.

Converting Indentation

To convert the indentation type and/or size in the current file, select the type of indentation to use in the Conversions section at the bottom of the tool. When converting to Spaces Only or Mixed Tabs & Spaces the Indent Size shown in the Statistics area can be changed to select the desired indent size.

The action that will be performed is explained in the area below the conversion type tabs. Press Convert to complete the operation in the editor.

Once conversion is complete, the Indentation tool updates to display the new status of the file. In Wing Pro, the conversion can be reviewed with Compare Buffer with Disk from the Difference/Merge toolbar icon.

Save the editor to make the conversion permanent, or use use Undo from the Edit menu while the editor has focus to discard the conversion.