From b14721fd7f0f39f2f8e0be72fad187f9b9b8418e Mon Sep 17 00:00:00 2001 From: Nathan Sobo Date: Tue, 27 Jul 2021 16:50:06 -0600 Subject: [PATCH] Clip left when moving vertically --- zed/src/editor/movement.rs | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/zed/src/editor/movement.rs b/zed/src/editor/movement.rs index 7b1cfc35974d64f348033eeaaffaaf8952359810..dc2f319e334fb6ff4195b5c987ca489c79abd310 100644 --- a/zed/src/editor/movement.rs +++ b/zed/src/editor/movement.rs @@ -40,7 +40,10 @@ pub fn up( point = DisplayPoint::new(0, 0); } - Ok((point, SelectionGoal::Column(goal_column))) + Ok(( + map.clip_point(point, Bias::Left), + SelectionGoal::Column(goal_column), + )) } pub fn down( @@ -62,7 +65,10 @@ pub fn down( point = max_point; } - Ok((point, SelectionGoal::Column(goal_column))) + Ok(( + map.clip_point(point, Bias::Left), + SelectionGoal::Column(goal_column), + )) } pub fn line_beginning(