Merge branch 'project-diagnostics-pinned-tab' into style-project-diagnostics

This commit is contained in:
Max Brunsfeld
2022-01-25 12:20:37 -08:00
13 changed files with 118 additions and 70 deletions
+4 -11
View File
@@ -121,13 +121,9 @@ impl ItemView for Editor {
}
}
fn title(&self, cx: &AppContext) -> String {
let file = self.buffer().read(cx).file(cx);
if let Some(file) = file {
file.file_name(cx).to_string_lossy().into()
} else {
"untitled".into()
}
fn tab_content(&self, style: &theme::Tab, cx: &AppContext) -> ElementBox {
let title = self.title(cx);
Label::new(title, style.label.clone()).boxed()
}
fn project_path(&self, cx: &AppContext) -> Option<ProjectPath> {
@@ -207,10 +203,7 @@ impl ItemView for Editor {
}
fn should_update_tab_on_event(event: &Event) -> bool {
matches!(
event,
Event::Saved | Event::Dirtied | Event::FileHandleChanged
)
matches!(event, Event::Saved | Event::Dirtied | Event::TitleChanged)
}
}