Allow editor to be saved when in multi-buffer mode

Also, this commit enables the customization of the title in a multi-buffer.
When specified, it will take precedence over a filename (or "untitled").
This commit is contained in:
Antonio Scandurra 2022-02-10 09:35:19 +01:00
parent 9ea535986f
commit dd223f93ec
4 changed files with 35 additions and 17 deletions

View file

@ -28,7 +28,7 @@ use std::{
sync::Arc,
};
use util::TryFutureExt;
use workspace::{ItemNavHistory, Workspace};
use workspace::{ItemNavHistory, ItemViewHandle as _, Workspace};
action!(Deploy);
action!(OpenExcerpts);
@ -573,7 +573,7 @@ impl workspace::ItemView for ProjectDiagnosticsEditor {
}
fn save(&mut self, cx: &mut ViewContext<Self>) -> Task<Result<()>> {
self.excerpts.update(cx, |excerpts, cx| excerpts.save(cx))
self.editor.save(cx)
}
fn can_save_as(&self, _: &AppContext) -> bool {