Change summary
crates/vim/src/motion.rs | 10 ++++++++++
crates/vim/test_data/test_space_non_ascii.json | 4 ++++
2 files changed, 14 insertions(+)
Detailed changes
@@ -1322,6 +1322,7 @@ fn wrapping_right_single(map: &DisplaySnapshot, mut point: DisplayPoint) -> Disp
let max_column = map.line_len(point.row()).saturating_sub(1);
if point.column() < max_column {
*point.column_mut() += 1;
+ point = map.clip_point(point, Bias::Right);
} else if point.row() < map.max_point().row() {
*point.row_mut() += 1;
*point.column_mut() = 0;
@@ -3598,4 +3599,13 @@ mod test {
fox jumps over
the lหยปazy dog"});
}
+
+ #[gpui::test]
+ async fn test_space_non_ascii(cx: &mut gpui::TestAppContext) {
+ let mut cx = NeovimBackedTestContext::new(cx).await;
+
+ cx.set_shared_state("หฯฯฯฯฯ").await;
+ cx.simulate_shared_keystrokes("3 space").await;
+ cx.shared_state().await.assert_eq("ฯฯฯหฯฯ");
+ }
}
@@ -0,0 +1,4 @@
+{"Put":{"state":"หฯฯฯฯฯ"}}
+{"Key":"3"}
+{"Key":"space"}
+{"Get":{"state":"ฯฯฯหฯฯ","mode":"Normal"}}