helix: Fix a cursor position in helix_select mode` (#57610)

Closes #56493

In Helix select mode, pressing `a` after a selection (e.g. `v a`) placed
the cursor one column too far to the right.

Bound `a` to `vim::HelixAppend` in the `helix_select` keymap so it
matches the behavior in `helix_normal`, and added a regression test for
the `v a` case.

Release Notes:

- Fixed cursor placement after pressing `a` in Helix select mode.

---------

Co-authored-by: Smit Barmase <heysmitbarmase@gmail.com>
This commit is contained in:
Pulkit Saraf 2026-05-28 08:06:38 +05:30 committed by GitHub
parent b141288fb0
commit 60374460f2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 11 additions and 1 deletions

View file

@ -338,7 +338,7 @@
"ctrl-x": "vim::Decrement",
"shift-j": "vim::JoinLines",
"i": "vim::InsertBefore",
"a": "vim::InsertAfter",
"a": "vim::HelixAppend",
"o": "vim::InsertLineBelow",
"shift-o": "vim::InsertLineAbove",
"p": "vim::Paste",

View file

@ -2572,6 +2572,16 @@ mod test {
assert_eq!(cx.mode(), Mode::HelixNormal);
}
#[gpui::test]
async fn test_helix_select_append(cx: &mut gpui::TestAppContext) {
let mut cx = VimTestContext::new(cx, true).await;
cx.enable_helix();
cx.set_state("aˇbcd", Mode::HelixNormal);
cx.simulate_keystrokes("v a");
cx.assert_state("abˇcd", Mode::Insert);
}
#[gpui::test]
async fn test_goto_last_modification(cx: &mut gpui::TestAppContext) {
let mut cx = VimTestContext::new(cx, true).await;