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

Clear selection when exiting visual mode #878

Merged

Conversation

thomasschafer
Copy link
Contributor

After exiting visual mode with Escape, the selection is currently not cleared until another action is performed such as moving the cursor left or right. This PR fixes that, clearing the selection as soon as Escape is pressed to match the behaviour of Vim.

@132ikl
Copy link

132ikl commented Feb 10, 2025

mentioned this in the Discord, but wanted to add it here also that #867 also implements this, so assuming we get that merged in a timely fashion we can close this PR in favor of #867. otherwise, we can merge this before next Nushell release.

Copy link
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ah making that part of the Esc handler itself is elegant. Should also transfer to the emacs style bindings.

If you want to revisit that part of #867 feel free to update the changes from it, otherwise this is closed by it.

@thomasschafer thomasschafer force-pushed the tschafer-clear-selection-with-escape branch from 26024f3 to 3614756 Compare February 12, 2025 19:46
@thomasschafer thomasschafer force-pushed the tschafer-clear-selection-with-escape branch from 3614756 to f642a38 Compare February 12, 2025 19:46
@thomasschafer
Copy link
Contributor Author

Ah making that part of the Esc handler itself is elegant. Should also transfer to the emacs style bindings.

If you want to revisit that part of #867 feel free to update the changes from it, otherwise this is closed by it.

I've just updated this PR in light of the changes in #867, let me know if this is what you were thinking!

Copy link
Member

@sholderbach sholderbach left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Sounds good to me. @132ikl or @deephbz do you have a use case where an explicit event for that would be helpful?

@132ikl
Copy link

132ikl commented Feb 13, 2025

hmm, i can't think of anything. it seems like it could be useful (maybe if you were doing a weird macro-y keybinding?), but honestly we could probably just revert this if anyone really wanted this available

@sholderbach sholderbach merged commit 4ca1ed9 into nushell:main Feb 13, 2025
6 checks passed
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.

3 participants