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

Fix Del and BS not working in Select mode #1079

Draft
wants to merge 18 commits into
base: master
Choose a base branch
from

Conversation

citizenmatt
Copy link
Member

@citizenmatt citizenmatt commented Jan 2, 2025

This PR fixes an issue when hitting <Del> or <BS> to delete selected text in Select mode would fail to delete anything. The implementation would try to invoke native actions to delete but had two problems. Firstly, it would fail to filter out the IdeaVim action bound to the keystroke and would recurse (but fail to invoke anything). Secondly, it would also try to invoke instances of EmptyAction, which are placeholder actions that are used to reserve a shortcut. Code will use look for these actions by ID to look up the shortcut to use when dynamically registering the real action locally in a Component. We gather these locally registered actions, so it's safe to ignore the empty action.

It also correctly transitions from Select mode to Normal or Insert/Replace, depending on context. If Select mode was started from Normal (via gh or v<C-G>), then it will return to Normal. If started in Insert/Replace mode via shifted keys, then it will return to Insert/Replace. As part of this, it correctly positions the caret, especially when deleting the last text character in a line.

Fixes VIM-3618 and VIM-3042.

This PR depends on #1078, specifically to handle the correct mode transitions. As such, it lists a load of unnecessary commits from that branch. Once #1078 is merged, I'll rebase, force push and mark this PR as no longer draft. Here is the list of commits in this PR: 272bea0...5275057

@citizenmatt citizenmatt marked this pull request as draft January 2, 2025 12:18
@citizenmatt citizenmatt force-pushed the bugfix/select-delete branch from 5e9c45e to 5b1b4ae Compare January 2, 2025 14:00
@shaunpatterson
Copy link
Contributor

Pulled this and tested.
Fixes VIM-3618 and VIM-3042. Confirmed (I wrote both tickets)

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