-
Notifications
You must be signed in to change notification settings - Fork 29.8k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Mirror cursor makes extra copy when duplicating row #87161
Comments
(Experimental duplicate detection) |
@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. |
I don't think this is can be considered a bug. Double cursors create double duplicates. This is the normal behavior. |
@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). |
The automatic double cursor is needed to edit the tag just once. |
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 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). |
In tomorrow's insiders |
Steps to Reproduce:
When cursor is not inside tag name everything is ok
Does this issue occur when all extensions are disabled?: Yes
The text was updated successfully, but these errors were encountered: