mirror of
https://github.com/zed-industries/zed.git
synced 2024-11-08 07:35:01 +03:00
clip FoldPoint earlier
fold_point_to_display_point calls to_offset on the fold point, which panics if it hasn't been clipped. https://zed-industries.slack.com/archives/C04S6T1T7TQ/p1694850156370919
This commit is contained in:
parent
7c77baa7c1
commit
c4797f87b4
@ -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(
|
||||
|
Loading…
Reference in New Issue
Block a user