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:
1 parent
5226db6eae
commit
808eceb5a8
2 files changed
+11
-1
No files matched your search
@@ -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",
|
||||
|
||||
@@ -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;
|
||||
|
||||
Reference in new issue
Block a user