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
This commit is contained in:
5brian 2025-06-27 12:18:26 -04:00 committed by GitHub
parent 7432e947bc
commit f9987a1141
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -1521,7 +1521,7 @@ impl SearchableItem for Editor {
fn query_suggestion(&mut self, window: &mut Window, cx: &mut Context<Self>) -> 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::<usize>(cx);
let selection = self.selections.newest_adjusted(cx);
match setting {
SeedQuerySetting::Never => String::new(),