You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Mirror cursor makes extra copy when duplicating row #87161
bugIssue identified by VS Code Team member as probable bugeditor-multicursorEditor multiple cursor issueseditor-synced-regionIssues related to synced region functionality in editorhtmlHTML support issuesverifiedVerification succeeded
Alexandru Dima (@alexdima) Would you take a PR that makes "duplicate line" only duplicate one line when both cursors are on the same line?
Or it might be more generic solution. Group all cursors by line number and then duplicate each line only once. If I add 3 cursors on first line, 5 cursors on second line and so on then press duplicate I do not need so much copies.
Hamza Hamidi (@hamzahamidi) That'd be fine if the user created the mirror cursor with an action (keyboard shortcut). Now you have to make sure where your cursor is located within a line before duplicating it, because the mirror cursor is created automatically when your main cursor is within a html tag.
It is possible to get rid of the mirror cursor with Esc, but that's an additional action to work around the problem. I find it hard to think of use cases where you would want to duplicate a line as many times as there's a cursor in that line (and then there's also a difference between multiple cursors and mirrored cursors).
Couldn't agree with you more. That's the entire point of the feature shipped in this months update. That said, the duplicate (and other) behaviour seems like an oversight during development.
The mirror cursor is meant to simplify modification of the tag. Duplicating the line with the mirrored cursor (be it on the same or other line) is a bit strange, as the intent was to duplicate the primary line and not the html tag (note the command name is Copy Line Down).
I feel like the mirror cursor is something unique and different from multiple cursors. It shouldn't follow the same behaviour as the normal cursor(s). Differentiating between them with visual styles would also communicate that better to the user (#85630).
Reacted by rickyhartmann, nelsonec87 and Guilherme Taffarel Bergamin
In tomorrow's insiders html.mirrorCursorOnMatchingTag is replaced with editor.renameOnType. The new implementation fixes this issue. You can find more details here: #88424 (comment)
bugIssue identified by VS Code Team member as probable bugeditor-multicursorEditor multiple cursor issueseditor-synced-regionIssues related to synced region functionality in editorhtmlHTML support issuesverifiedVerification succeeded
Activity
vscodebot commentedon Dec 17, 2019
(Experimental duplicate detection)
Thanks for submitting this issue. Please also check if it is already covered by an existing one, like:
octref commentedon Dec 17, 2019
Alexandru Dima (@alexdima) Would you take a PR that makes "duplicate line" only duplicate one line when both cursors are on the same line?
SavchukSergey commentedon Dec 19, 2019
Or it might be more generic solution. Group all cursors by line number and then duplicate each line only once. If I add 3 cursors on first line, 5 cursors on second line and so on then press duplicate I do not need so much copies.
hamzahamidi commentedon Dec 21, 2019
I don't think this is can be considered a bug. Double cursors create double duplicates. This is the normal behavior.
Errors4l commentedon Dec 24, 2019
Hamza Hamidi (@hamzahamidi) That'd be fine if the user created the mirror cursor with an action (keyboard shortcut). Now you have to make sure where your cursor is located within a line before duplicating it, because the mirror cursor is created automatically when your main cursor is within a html tag.
It is possible to get rid of the mirror cursor with Esc, but that's an additional action to work around the problem. I find it hard to think of use cases where you would want to duplicate a line as many times as there's a cursor in that line (and then there's also a difference between multiple cursors and mirrored cursors).
hamzahamidi commentedon Dec 24, 2019
The automatic double cursor is needed to edit the tag just once.
Errors4l commentedon Dec 24, 2019
Couldn't agree with you more. That's the entire point of the feature shipped in this months update. That said, the duplicate (and other) behaviour seems like an oversight during development.
The mirror cursor is meant to simplify modification of the tag. Duplicating the line with the mirrored cursor (be it on the same or other line) is a bit strange, as the intent was to duplicate the primary line and not the html tag (note the command name is
Copy Line Down).I feel like the mirror cursor is something unique and different from multiple cursors. It shouldn't follow the same behaviour as the normal cursor(s). Differentiating between them with visual styles would also communicate that better to the user (#85630).
octref commentedon Mar 18, 2020
In tomorrow's insiders
html.mirrorCursorOnMatchingTagis replaced witheditor.renameOnType. The new implementation fixes this issue. You can find more details here: #88424 (comment)