Skip to content

armgit / zed

Public Imported from GitHub
0

Code at the speed of thought – Zed is a high-performance, multiplayer code editor from the creators of Atom and Tree-sitter.

clip FoldPoint earlier

Conrad Irwinc4797f87b4ad
diff --git a/crates/vim/src/motion.rs b/crates/vim/src/motion.rs
index 3e65e6d504c..209b43772f6 100644
--- a/crates/vim/src/motion.rs
+++ b/crates/vim/src/motion.rs
@@ -536,9 +536,12 @@ fn down(
map.buffer_snapshot.max_point().row,
);
let new_col = cmp::min(goal_column, map.fold_snapshot.line_len(new_row));
- let point = map.fold_point_to_display_point(FoldPoint::new(new_row, new_col));
+ let point = map.fold_point_to_display_point(
+ map.fold_snapshot
+ .clip_point(FoldPoint::new(new_row, new_col), Bias::Left),
+ );
- (map.clip_point(point, Bias::Left), goal)
+ (point, goal)
}
fn down_display(
@@ -573,9 +576,12 @@ pub(crate) fn up(
let new_row = start.row().saturating_sub(times as u32);
let new_col = cmp::min(goal_column, map.fold_snapshot.line_len(new_row));
- let point = map.fold_point_to_display_point(FoldPoint::new(new_row, new_col));
+ let point = map.fold_point_to_display_point(
+ map.fold_snapshot
+ .clip_point(FoldPoint::new(new_row, new_col), Bias::Left),
+ );
- (map.clip_point(point, Bias::Left), goal)
+ (point, goal)
}
fn up_display(