Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.
vim change for wrapped lines
Conrad Irwin0280d5d01092
diff --git a/crates/vim/src/motion.rs b/crates/vim/src/motion.rsindex 8cd29e5e9f1..a85c6fc0a34 100644--- a/crates/vim/src/motion.rs+++ b/crates/vim/src/motion.rs@@ -1,4 +1,4 @@-use std::sync::Arc;+use std::{cmp, sync::Arc};use editor::{char_kind,@@ -404,9 +404,13 @@ fn down(mut goal: SelectionGoal,times: usize,) -> (DisplayPoint, SelectionGoal) {- for _ in 0..times {+ let start_row = point.to_point(map).row;+ let target = cmp::min(map.max_buffer_row(), start_row + times as u32);++ while point.to_point(map).row < target {(point, goal) = movement::down(map, point, goal, true);}+(point, goal)}@@ -416,7 +420,10 @@ fn up(mut goal: SelectionGoal,times: usize,) -> (DisplayPoint, SelectionGoal) {- for _ in 0..times {+ let start_row = point.to_point(map).row;+ let target = start_row.saturating_sub(times as u32);++ while point.to_point(map).row > target {(point, goal) = movement::up(map, point, goal, true);}(point, goal)