Release Notes:

- vim: Fix `gi` when the insert ended at the end of a line (#12162)
- vim: Add `gv` to restore previous visual selection (#12888)
- vim: Fix `gl` when the first match is at the end of a line
This commit is contained in:
Conrad Irwin 2024-06-14 10:16:59 -06:00 committed by GitHub
parent 3539a7c04a
commit 3b84b106e2
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
12 changed files with 239 additions and 49 deletions

View file

@ -1,4 +1,8 @@
use crate::{normal::repeat, state::Mode, Vim};
use crate::{
normal::{mark::create_mark, repeat},
state::Mode,
Vim,
};
use editor::{scroll::Autoscroll, Bias};
use gpui::{actions, Action, ViewContext};
use language::SelectionGoal;
@ -15,6 +19,7 @@ fn normal_before(_: &mut Workspace, action: &NormalBefore, cx: &mut ViewContext<
let count = vim.take_count(cx).unwrap_or(1);
vim.stop_recording_immediately(action.boxed_clone());
if count <= 1 || vim.workspace_state.replaying {
create_mark(vim, "^".into(), false, cx);
vim.update_active_editor(cx, |_, editor, cx| {
editor.dismiss_menus_and_popups(false, cx);
editor.change_selections(Some(Autoscroll::fit()), cx, |s| {