Allow a new search to be created with cmd-enter

This replaces the `cmd-alt-shift-F` binding to open a new search. Instead, you can preserve the existing search results by entering a query and then hitting `cmd-enter` instead of `enter`. This opens a new project find view and restores the previous view to whatever query it was previously displaying. It's a bit strange, but I don't want to rely on splitting as the only way of creating multiple sets of search results.
This commit is contained in:
Nathan Sobo 2022-02-26 13:23:05 -07:00
parent ae1a46a4e4
commit 2f427769df
3 changed files with 578 additions and 514 deletions

View file

@ -1345,6 +1345,13 @@ impl Buffer {
let _ = language_server.latest_snapshot.blocking_send(snapshot);
}
pub fn set_text<T>(&mut self, text: T, cx: &mut ModelContext<Self>) -> Option<clock::Local>
where
T: Into<String>,
{
self.edit_internal([0..self.len()], text, false, cx)
}
pub fn edit<I, S, T>(
&mut self,
ranges_iter: I,