mirror of
https://github.com/zed-industries/zed.git
synced 2026-05-31 19:05:00 +07:00
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:
parent
b141288fb0
commit
60374460f2
2 changed files with 11 additions and 1 deletions
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue