-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Feature: New command - Delete Duplicate Lines #119480
Conversation
I think the logic should instead be: if there is one selection, delete duplicate lines like you did, but if there are multiple selections, delete duplicate selections. Also, this would probably be closed as an "extension-candidate", which makes sense but doesn't justify having sorting commands built-in while this isn't. Btw PRs need to have an issue associated with them, I'm assuming a really old issue already exists but I couldn't find any |
I based the behaviour on Sublime Text. It's also consistent with the other built-in commands, which are dealing with lines, not selections. I also think it'd just be confusing to the user if the command switched between deleting lines and deleting selections based on the amount of selections. From personal experience, I don't recall ever needing a "delete duplicate selections" action. If there's need for it then that could just be implemented as a separate command.
Yep, I agree with this, also listed this as a question above. Will leave it to project stakeholders to decide. |
Duplicate selection & Copy/Cut commands work differently based on the selection. I'd argue that a separate command is more confusing and annoying, but I guess both use cases might be useful, so idk. |
Thank you! |
Description
VS Code implements a set of useful commands to mutate lines in the current selection(s), e.g.
This PR implements a new command:
Screenshot:
This is useful when mass-editing lines of text. For me personally it's probably the last thing that I miss from Sublime Text, as a converted VS Code user.
Open questions
If anything needs adjusting, I'm happy to alter the PR. Please do let me know.