vim: Fix gU$ (#20057)

Closes: #19380

Release Notes:

- vim: Fixed `gu$` missing last character of the line
This commit is contained in:
Conrad Irwin 2024-10-31 23:25:54 -06:00 committed by GitHub
parent 75f1862268
commit ecb874db62
No known key found for this signature in database
GPG Key ID: B5690EEEBB952194
2 changed files with 10 additions and 1 deletions

View File

@ -28,6 +28,7 @@ impl Vim {
) {
self.stop_recording(cx);
self.update_editor(cx, |_, editor, cx| {
editor.set_clip_at_line_ends(false, cx);
let text_layout_details = editor.text_layout_details(cx);
editor.transact(cx, |editor, cx| {
let mut selection_starts: HashMap<_, _> = Default::default();
@ -52,6 +53,7 @@ impl Vim {
});
});
});
editor.set_clip_at_line_ends(true, cx);
});
}
@ -261,7 +263,7 @@ mod test {
#[gpui::test]
async fn test_change_case_motion(cx: &mut gpui::TestAppContext) {
let mut cx = NeovimBackedTestContext::new(cx).await;
// works in visual mode
cx.set_shared_state("ˇabc def").await;
cx.simulate_shared_keystrokes("g shift-u w").await;
cx.shared_state().await.assert_eq("ˇABC def");
@ -281,5 +283,8 @@ mod test {
cx.simulate_shared_keystrokes(".").await;
cx.shared_state().await.assert_eq("ˇabc def");
cx.simulate_shared_keystrokes("g shift-u $").await;
cx.shared_state().await.assert_eq("ˇABC DEF");
}
}

View File

@ -21,3 +21,7 @@
{"Get":{"state":"ˇABC def","mode":"Normal"}}
{"Key":"."}
{"Get":{"state":"ˇabc def","mode":"Normal"}}
{"Key":"g"}
{"Key":"shift-u"}
{"Key":"$"}
{"Get":{"state":"ˇABC DEF","mode":"Normal"}}