Skip to content

Leave selection unchanged when applying ToggleLineComment #36349

@justcla

Description

@justcla

When user applies ToggleLineComment to a selection, can the selection be left untouched?


#27198 (comment)

Really nice to see this in Visual Studio 16.1!!

Obviously, it will be better when applied to a single-key shortcut instead of a chord.

Also, the changing of caret position and selection is really annoying. It keeps moving my caret to the end of the line, which is not helpful.

Notes:

For ToggleLineComment applied to a single line with no selection, it would be more useful if it moved the caret down one line. (And keep the caret at the same column position)
This could be a setting in Tools->Options (on by default)
Leave the caret where it started. When applying ToggleLineComment there is no need for the selection to change. Also, there is no need for the caret to move. It can stay where it was. Just need to apply comment markers to the start of each line involved in the selection. (Except for the last line if caret at posn 0).

Metadata

Metadata

Assignees

Type

No type
No fields configured for issues without a type.

Projects

No projects

Relationships

None yet

Development

No branches or pull requests

Issue actions