Skip to content

Commit

Permalink
Fix register selection in visual mode
Browse files Browse the repository at this point in the history
  • Loading branch information
ConradIrwin committed Sep 27, 2024
1 parent c83d007 commit 44b1399
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
1 change: 0 additions & 1 deletion crates/vim/src/normal/mark.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,6 @@ impl Vim {
self.marks.insert("<".to_string(), starts);
self.marks.insert(">".to_string(), ends);
self.stored_visual_mode.replace((mode, reversed));
self.clear_operator(cx);
}

pub fn jump(&mut self, text: Arc<str>, line: bool, cx: &mut ViewContext<Self>) {
Expand Down
3 changes: 3 additions & 0 deletions crates/vim/src/normal/paste.rs
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,9 @@ mod test {
cx.simulate_shared_keystrokes("\" _ d d").await;
cx.shared_register('_').await.assert_eq("");

cx.simulate_shared_keystrokes("shift-v \" _ y w").await;
cx.shared_register('"').await.assert_eq("jumps");

cx.shared_state().await.assert_eq(indoc! {"
The quick brown
the ˇlazy dog"});
Expand Down
7 changes: 7 additions & 0 deletions crates/vim/test_data/test_special_registers.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,6 +10,13 @@
{"Key":"d"}
{"Get":{"state":"The quick brown\nthe ˇlazy dog","mode":"Normal"}}
{"ReadRegister":{"name":"_","value":""}}
{"Key":"shift-v"}
{"Key":"\""}
{"Key":"_"}
{"Key":"y"}
{"Key":"w"}
{"Get":{"state":"The quick brown\nthe ˇlazy dog","mode":"Normal"}}
{"ReadRegister":{"name":"\"","value":"jumps"}}
{"Get":{"state":"The quick brown\nthe ˇlazy dog","mode":"Normal"}}
{"Key":"\""}
{"Key":"\""}
Expand Down

0 comments on commit 44b1399

Please sign in to comment.