From c18be3ecd0fe256cf2796a7964506464275e0d14 Mon Sep 17 00:00:00 2001 From: 0x2CA <2478557459@qq.com> Date: Fri, 21 Feb 2025 01:24:34 +0800 Subject: [PATCH] vim: Fix cursor shape hollow only in block (#25235) Closes #ISSUE Before this, in Vim mode, as long as the window loses focus, regardless of the current cursor shape, it will definitely switch to a hollow cursor. Release Notes: - Fixed vim cursor shape hollow only in block --- crates/vim/src/vim.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/crates/vim/src/vim.rs b/crates/vim/src/vim.rs index f6f77f6dd2..babec185ca 100644 --- a/crates/vim/src/vim.rs +++ b/crates/vim/src/vim.rs @@ -1146,8 +1146,10 @@ impl Vim { self.stop_recording_immediately(NormalBefore.boxed_clone(), cx); self.store_visual_marks(window, cx); self.clear_operator(window, cx); - self.update_editor(window, cx, |_, editor, _, cx| { - editor.set_cursor_shape(language::CursorShape::Hollow, cx); + self.update_editor(window, cx, |vim, editor, _, cx| { + if vim.cursor_shape() == CursorShape::Block { + editor.set_cursor_shape(CursorShape::Hollow, cx); + } }); }