From 3f2f3bb78dec914f0ab627111851d8b370918304 Mon Sep 17 00:00:00 2001 From: Conrad Irwin Date: Fri, 28 Jul 2023 13:46:25 -0600 Subject: [PATCH] Fix crash when deleting a long line in visual line mode --- crates/vim/src/visual.rs | 18 ++++++++++++++++-- .../vim/test_data/test_visual_line_delete.json | 5 +++++ 2 files changed, 21 insertions(+), 2 deletions(-) diff --git a/crates/vim/src/visual.rs b/crates/vim/src/visual.rs index eae3c80f38..cad82bc1ea 100644 --- a/crates/vim/src/visual.rs +++ b/crates/vim/src/visual.rs @@ -197,6 +197,7 @@ pub fn delete(_: &mut Workspace, _: &VisualDelete, cx: &mut ViewContext = Default::default(); let line_mode = editor.selections.line_mode; + editor.change_selections(Some(Autoscroll::fit()), cx, |s| { s.move_with(|map, selection| { if line_mode { @@ -218,9 +219,13 @@ pub fn delete(_: &mut Workspace, _: &VisualDelete, cx: &mut ViewContext