Clip left when moving cursor to end of line

This ensures we stay on the same line when the current display line ends with a soft wrap.
This commit is contained in:
Nathan Sobo
2021-07-30 09:50:28 -07:00
committed by Max Brunsfeld
parent b14721fd7f
commit 47187172b7
+2 -1
View File
@@ -85,7 +85,8 @@ pub fn line_beginning(
}
pub fn line_end(map: &DisplayMapSnapshot, point: DisplayPoint) -> Result<DisplayPoint> {
Ok(DisplayPoint::new(point.row(), map.line_len(point.row())))
let line_end = DisplayPoint::new(point.row(), map.line_len(point.row()));
Ok(map.clip_point(line_end, Bias::Left))
}
pub fn prev_word_boundary(map: &DisplayMapSnapshot, point: DisplayPoint) -> Result<DisplayPoint> {