Distinguish between singleton and non-singleton workspace items
* Prompt to save singleton items before non-singleton ones * Don't prompt to save multi-buffers if they contain excerpts to items that are open elsewhere and not being closed. Co-authored-by: Nathan Sobo <nathan@zed.dev>
This commit is contained in:
parent
fbd589b589
commit
0becbe482a
6 changed files with 190 additions and 115 deletions
|
@ -240,6 +240,10 @@ impl Item for ProjectSearchView {
|
|||
self.results_editor.project_entry_ids(cx)
|
||||
}
|
||||
|
||||
fn is_singleton(&self, _: &AppContext) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn can_save(&self, _: &gpui::AppContext) -> bool {
|
||||
true
|
||||
}
|
||||
|
@ -261,10 +265,6 @@ impl Item for ProjectSearchView {
|
|||
.update(cx, |editor, cx| editor.save(project, cx))
|
||||
}
|
||||
|
||||
fn can_save_as(&self, _: &gpui::AppContext) -> bool {
|
||||
false
|
||||
}
|
||||
|
||||
fn save_as(
|
||||
&mut self,
|
||||
_: ModelHandle<Project>,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue