From 79e7ccc1fe7e1cbd0cb9960e6a1a66df63158eef Mon Sep 17 00:00:00 2001 From: Dino Date: Mon, 9 Jun 2025 03:12:23 -0700 Subject: [PATCH] vim: Handle case sensitive search editor setting (#32276) Update the `vim::normal::search::Vim.search` method in order to correctly set the search bar's case sensitive search option if the `search.case_sensitive` setting is enabled. Closes #32172 Release Notes: - vim: Fixed a bug where the `search.case_sensitive` setting was not respected when activating search with / (`vim::Search`) --- crates/vim/src/normal/search.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/crates/vim/src/normal/search.rs b/crates/vim/src/normal/search.rs index 2f723198b6ea9adbd62c9360d545912a4e397aa7..1c45e6de4ce82aca1d39c7221768a501e104aafb 100644 --- a/crates/vim/src/normal/search.rs +++ b/crates/vim/src/normal/search.rs @@ -1,9 +1,10 @@ -use editor::Editor; +use editor::{Editor, EditorSettings}; use gpui::{Context, Window, actions, impl_actions, impl_internal_actions}; use language::Point; use schemars::JsonSchema; use search::{BufferSearchBar, SearchOptions, buffer_search}; use serde_derive::Deserialize; +use settings::Settings; use std::{iter::Peekable, str::Chars}; use util::serde::default_true; use workspace::{notifications::NotifyResultExt, searchable::Direction}; @@ -158,6 +159,9 @@ impl Vim { if action.backwards { options |= SearchOptions::BACKWARDS; } + if EditorSettings::get_global(cx).search.case_sensitive { + options |= SearchOptions::CASE_SENSITIVE; + } search_bar.set_search_options(options, cx); let prior_mode = if self.temp_mode { Mode::Insert