Fix clipping when dragging the mouse with vim-mode enabled and adjust single line editor selections

This commit is contained in:
K Simmons
2022-07-19 17:18:17 -07:00
parent c2868a39e8
commit 1cfaac1bc5
9 changed files with 36 additions and 43 deletions
+5 -5
View File
@@ -1643,12 +1643,12 @@ impl PaintState {
} else {
0
};
let column_overshoot = (0f32.max(x - line.width()) / layout.em_advance) as u32;
(
DisplayPoint::new(row, column),
DisplayPoint::new(row_overshoot, column_overshoot),
)
let point = snapshot.clip_point(DisplayPoint::new(row, column), Bias::Left);
let mut column_overshoot = (0f32.max(x - line.width()) / layout.em_advance) as u32;
column_overshoot = column_overshoot + column - point.column();
(point, DisplayPoint::new(row_overshoot, column_overshoot))
}
}