-
Notifications
You must be signed in to change notification settings - Fork 757
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
citizenmatt
wants to merge
18
commits into
JetBrains:master
Choose a base branch
from
citizenmatt:bugfix/select-delete
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
Draft
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Wanting to add `ReturnTo.SELECT` would be very tricky, as we would have to recreate the mode, but have no details about the selection type.
citizenmatt
force-pushed
the
bugfix/select-delete
branch
from
January 2, 2025 14:00
5e9c45e
to
5b1b4ae
Compare
From Select mode, enters Visual for a single command
Fixes VIM-3618
Fixes VIM-3042
citizenmatt
force-pushed
the
bugfix/select-delete
branch
from
January 3, 2025 00:05
5b1b4ae
to
5275057
Compare
4 tasks
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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 ofEmptyAction
, 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 aComponent
. 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
orv<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