Tim,
ReIndent Selection command (Format menu)
This command allows the user to reformat the selected text within the active file. This is typically used by programmers to reformat existing text according to the indentation settings in configuration and the automatic indent settings for Syntax Highlighting (see the indentation section under Syntax Highlighting for details).
When the reindenting is performed, UltraEdit will reindent the file line by line, starting with the indentation of the first selected line.
If the indentation of the first selected line is less than the indent setting, or falls between multiples of the indent setting then the indentation will be rounded down to match the value or multiple of the indent setting. (If the indent value is 4, and the first selected line is indented to 2 then the line will be assumed not to be indented as it will be rounded down to 0. If the line was indented to 6 then the line will be adjusted to be indented to 4 as it falls between the indent values of 4 and
.
UltraEdit does try and determine if the statement causing a change in the indentation is commented out, or part of a string and ignores it in this case. However, if the file contains preprocessor conditional statements (#ifdef, #ifndef, etc.) UltraEdit does not attempt to determine which text is valid and which is not. This may cause lines to be adjusted incorrectly.
To avoid problems with conditional statements it is suggested that all conditional sections include the same number of open and close conditional statements. If an "if (test) {" statement is in the conditional text, make sure the closing brace ("}") is also in the conditional text and there should not be a problem.
In some cases it may be desirable not to indent lines such as compiler directives or comments. UltraEdit provides for this capability by allowing strings to be ignored to be defined in the wordfile.txt file. This is covered under the Syntax Highlighting section.