After pressing Enter inside a multi-line comment, Visual Assist inserts the appropriate comment token automatically on the next line, at the correct indent level. New lines may be added to the end of a comment or inserted in the middle, depending on the current location of the text caret.
Both single-line style and block style comments may be auto-extended.
Single-line style comments
Only comments that already span at least two lines are auto-extended. The exception to this rule is a comment typed on the first line of a file, in which case the comment is auto-extended after just one line to facilitate file header comments.
Use one of these methods to stop auto-extending a single-line style comment:
- Press Enter immediately after the last desired comment token has been inserted
- Backspace over the last inserted comment token
- Use the IDE's LineDelete command (Ctrl+Shift+L) to quickly remove the last inserted token and reposition the text caret
In addition to these methods, navigating to another part of the file using the keyboard or mouse will cancel the auto-extend operation.
Block style comments
Comments are auto-extended for all lines, including the first line. Pressing Enter immediately after a token is inserted also auto-extends the comment. To stop auto-extending a block style comment, type the terminating token.
The indent level from the beginning of the line to the inserted comment token is preserved, as is any white space between the comment token and the typed text.
Enable or disable this feature in the options dialog for Visual Assist.