diff --git a/zed/src/editor/movement.rs b/zed/src/editor/movement.rs index dc2f319e334fb6ff4195b5c987ca489c79abd310..0130e6b9e83828e8f43059b7b560423cdc99aa9b 100644 --- a/zed/src/editor/movement.rs +++ b/zed/src/editor/movement.rs @@ -85,7 +85,8 @@ pub fn line_beginning( } pub fn line_end(map: &DisplayMapSnapshot, point: DisplayPoint) -> Result { - 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 {