Allow buffer search in project search (#23819)

Closes #13437
Closes #19993

Release Notes:

- Allow searching within the results of a project search
- vim: Fix `/`/`?`, `n`/`N`, `gn`/`gN`,`*`/`#` in project search results

---------

Co-authored-by: Nico <nico.lehmann@gmail.com>
This commit is contained in:
Conrad Irwin 2025-01-31 00:13:46 -07:00 committed by GitHub
parent e1af35aa15
commit f2b3f3a9ab
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
10 changed files with 191 additions and 105 deletions

View file

@ -421,6 +421,9 @@ impl Item for ProjectSearchView {
None
}
}
fn as_searchable(&self, _: &Entity<Self>) -> Option<Box<dyn SearchableItemHandle>> {
Some(Box::new(self.results_editor.clone()))
}
fn deactivated(&mut self, window: &mut Window, cx: &mut Context<Self>) {
self.results_editor
@ -736,6 +739,7 @@ impl ProjectSearchView {
let mut editor =
Editor::for_multibuffer(excerpts, Some(project.clone()), true, window, cx);
editor.set_searchable(false);
editor.set_in_project_search(true);
editor
});
subscriptions.push(cx.observe(&results_editor, |_, _, cx| cx.emit(ViewEvent::UpdateTab)));