Fix register selection in visual mode (#18418)

Related to #12895

Release Notes:

- vim: Fix register selection in visual yank
This commit is contained in:
Conrad Irwin 2024-09-26 20:27:49 -06:00 committed by GitHub
parent c83d007138
commit 32605e9ea4
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
3 changed files with 10 additions and 1 deletions

View file

@ -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>) {

View file

@ -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"});

View file

@ -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":"\""}