From 0d6fb08b67e26f5e6abd14ff51b3a9ba1d89b9c0 Mon Sep 17 00:00:00 2001 From: Thorsten Ball Date: Thu, 25 Apr 2024 17:56:53 +0200 Subject: [PATCH] vim: set cursor to hollow-block if editor loses focus (#10995) This has been bugging me for a while now. Finally figured out how to do it. Release Notes: - Fixed cursor in Vim mode not changing into a hollow block when editor loses focus. Demo: https://github.com/zed-industries/zed/assets/1185253/c7585282-156d-4ab2-b516-eb1940d6d0d3 --- crates/vim/src/editor_events.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/crates/vim/src/editor_events.rs b/crates/vim/src/editor_events.rs index 3fccf2eba1..ee5f4cde09 100644 --- a/crates/vim/src/editor_events.rs +++ b/crates/vim/src/editor_events.rs @@ -51,6 +51,9 @@ fn blurred(editor: View, cx: &mut WindowContext) { vim.clear_operator(cx); } } + editor.update(cx, |editor, cx| { + editor.set_cursor_shape(language::CursorShape::Hollow, cx); + }); }); }