mirror of
https://github.com/zed-industries/zed.git
synced 2025-01-12 13:24:19 +00:00
Always clip buffer points when clipping display points
Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
f898dc6dae
commit
4c22774694
2 changed files with 8 additions and 16 deletions
|
@ -598,7 +598,6 @@ impl BlockSnapshot {
|
|||
}
|
||||
|
||||
let output_start = Point::new(output_start_row.0, 0);
|
||||
if point.0 > output_start {
|
||||
let output_overshoot = point.0 - output_start;
|
||||
let input_start = Point::new(input_start_row.0, 0);
|
||||
let input_point = self
|
||||
|
@ -606,9 +605,6 @@ impl BlockSnapshot {
|
|||
.clip_point(WrapPoint(input_start + output_overshoot), bias);
|
||||
let input_overshoot = input_point.0 - input_start;
|
||||
return BlockPoint(output_start + input_overshoot);
|
||||
} else {
|
||||
return BlockPoint(output_start);
|
||||
}
|
||||
} else if search_left {
|
||||
cursor.prev(&());
|
||||
} else {
|
||||
|
|
|
@ -691,11 +691,7 @@ impl FoldSnapshot {
|
|||
let buffer_position = cursor.start().1 + overshoot;
|
||||
let clipped_buffer_position =
|
||||
self.buffer_snapshot.clip_point(buffer_position, bias);
|
||||
FoldPoint::new(
|
||||
point.row(),
|
||||
((point.column() as i32) + clipped_buffer_position.column as i32
|
||||
- buffer_position.column as i32) as u32,
|
||||
)
|
||||
FoldPoint(cursor.start().0 .0 + (clipped_buffer_position - cursor.start().1))
|
||||
}
|
||||
} else {
|
||||
FoldPoint(self.transforms.summary().output.lines)
|
||||
|
|
Loading…
Reference in a new issue