Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

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

Pulkit Saraf60374460f263
diff --git a/assets/keymaps/vim.json b/assets/keymaps/vim.json
index 1e731efd96c..ef414018681 100644
--- a/assets/keymaps/vim.json
+++ b/assets/keymaps/vim.json
@@ -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",
diff --git a/crates/vim/src/helix.rs b/crates/vim/src/helix.rs
index b1ce35431c5..5c4b26cdaa0 100644
--- a/crates/vim/src/helix.rs
+++ b/crates/vim/src/helix.rs
@@ -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;