Always clip buffer points when clipping display points

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-12-15 17:58:24 -08:00
co-authored by Nathan Sobo
parent f898dc6dae
commit 4c22774694
2 changed files with 8 additions and 16 deletions
+1 -5
View File
@@ -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)