Line 1: | Line 1: | ||
[[Category:Format tab]] | [[Category:Format tab]] | ||
− | '''Reindent selection''' allows you to reformat the selected text within the active file. This is typically used when typing source code to reformat existing text according to the settings in [[Settings:Editor: | + | '''Reindent selection''' allows you to reformat the selected text within the active file. This is typically used when typing source code to reformat existing text according to the settings in [[Settings:Editor:Word_wrap_/_tab_settings|Settings » Editor » Word wrap/tab settings]] and the automatic [[Wordfiles#Indent_.2F_unindent_strings|indent / unindent strings]] settings for syntax highlighting. The file must be syntax highlighted with a wordfile containing indent / unindent strings in order for reindent selection to have any effect. |
When reindenting, UltraEdit will reindent the selection line by line, starting by "resetting" the indentation of the first line in the selection to column 1 and then applying reindentation to other lines from that point forward until the end of the selection, based upon the indent / unindent strings in the wordfile. | When reindenting, UltraEdit will reindent the selection line by line, starting by "resetting" the indentation of the first line in the selection to column 1 and then applying reindentation to other lines from that point forward until the end of the selection, based upon the indent / unindent strings in the wordfile. |
Reindent selection allows you to reformat the selected text within the active file. This is typically used when typing source code to reformat existing text according to the settings in Settings » Editor » Word wrap/tab settings and the automatic indent / unindent strings settings for syntax highlighting. The file must be syntax highlighted with a wordfile containing indent / unindent strings in order for reindent selection to have any effect.
When reindenting, UltraEdit will reindent the selection line by line, starting by "resetting" the indentation of the first line in the selection to column 1 and then applying reindentation to other lines from that point forward until the end of the selection, based upon the indent / unindent strings in the wordfile.
UltraEdit will try and determine if the statement causing a change in the indentation is part of a comment or 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 recommended that all conditional sections include the same number of open and close conditional statements. For examplel, if an if (test) {
statement is in the conditional text, make sure the closing brace }
is also in the conditional text.
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 active wordfile.