Skip to content
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

modify duplicateLine to keep cursor still #3645

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

notwithering
Copy link

see #3635

  • when duplicating line it will keep the cursor still, this allows for bindings similar to DuplicateLine,CursorDown to duplicate down or just DuplicateLine for duplicating up

i'm also having trouble implementing a "selection down" action that moves the entire selection down, it will only move the selection down one line while DuplicateLine may add more than one line

also fixes issue where undo or changing the selection can revert to `origSelection`
@notwithering
Copy link
Author

@dmaluka what are your thoughts on the "selection down" action?

@dmaluka
Copy link
Collaborator

dmaluka commented Feb 2, 2025

also fixes issue where undo

Does it?

what are your thoughts on the "selection down" action?

I remember you suggested it in #3635 (comment) but it doesn't make a lot of sense to me to have such a "generic" action independent of Duplicate*. The text below the selection is generally not the same text as where the selection is, it is a completely different text. So if we move the selection down, what happens? Some random part of this text gets selected, which is hardly useful.

@notwithering
Copy link
Author

not entirely sure anymore, i think its safe for this to put in as is. maybe keeping the cursor still is all that should be merged

@notwithering notwithering marked this pull request as ready for review February 2, 2025 21:21
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants