Add clip_to_line_end to display_map/snapshot and set it to ensure vim positioning in normal mode

Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
Keith Simmons 2022-03-25 18:09:37 -07:00
parent bb9b36dccd
commit 0aaf270650
10 changed files with 142 additions and 104 deletions

View file

@ -20,7 +20,7 @@ pub fn init(cx: &mut MutableAppContext) {
fn normal_before(_: &mut Workspace, _: &NormalBefore, cx: &mut ViewContext<Workspace>) {
VimState::switch_mode(&SwitchMode(Mode::Normal), cx);
VimState::update_active_editor(cx, |editor, cx| {
editor.adjusted_move_cursors(cx, |map, mut cursor, _| {
editor.clipped_move_cursors(cx, |map, mut cursor, _| {
*cursor.column_mut() = cursor.column().saturating_sub(1);
(map.clip_point(cursor, Bias::Left), SelectionGoal::None)
});