From f9987a11419cc7ea2c7a06a6a8017b9d1232ed11 Mon Sep 17 00:00:00 2001 From: 5brian Date: Fri, 27 Jun 2025 12:18:26 -0400 Subject: [PATCH] vim: Grep in visual line (#33414) From https://github.com/zed-industries/zed/pull/10831#issuecomment-2078523272 > I agree with not prefilling the search bar with a multiline query. Not sure if it's a bug that a one-line visual line selection does not get pre filled, this PR corrects the query to use the visual line selection instead of the 'normal' selection Release Notes: - N/A --- crates/editor/src/items.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 4993ff689507ebc4478d4a92164360dd6e734a9e..ec3590dba217677bbaf2c8aa36bfd3147b9d6cbf 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -1521,7 +1521,7 @@ impl SearchableItem for Editor { fn query_suggestion(&mut self, window: &mut Window, cx: &mut Context) -> String { let setting = EditorSettings::get_global(cx).seed_search_query_from_cursor; let snapshot = &self.snapshot(window, cx).buffer_snapshot; - let selection = self.selections.newest::(cx); + let selection = self.selections.newest_adjusted(cx); match setting { SeedQuerySetting::Never => String::new(),