Fix prev_row_boundary when a wrap follows a fold

Co-Authored-By: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Max Brunsfeld
2021-12-15 18:30:09 -08:00
co-authored by Nathan Sobo
parent 4c22774694
commit 3e2f684545
2 changed files with 21 additions and 2 deletions
@@ -672,6 +672,15 @@ impl WrapSnapshot {
WrapPoint(cursor.start().1 .0 + (point.0 - cursor.start().0 .0))
}
pub fn from_tab_point_with_clipping(&self, point: TabPoint, bias: Bias) -> WrapPoint {
let mut cursor = self.transforms.cursor::<(TabPoint, WrapPoint)>();
cursor.seek(&point, bias, &());
self.clip_point(
WrapPoint(cursor.start().1 .0 + (point.0 - cursor.start().0 .0)),
bias,
)
}
pub fn clip_point(&self, mut point: WrapPoint, bias: Bias) -> WrapPoint {
if bias == Bias::Left {
let mut cursor = self.transforms.cursor::<WrapPoint>();