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 <kbd>/</kbd> (`vim::Search`)
This commit is contained in:
Dino 2025-06-09 03:12:23 -07:00 committed by GitHub
parent 0bc9478b46
commit 79e7ccc1fe
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -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