chore: use only filename in tab content
Co-authored-by: Conrad Irwin <conrad.irwin@gmail.com>
This commit is contained in:
parent
67b3f80003
commit
b6600d0766
1 changed files with 9 additions and 3 deletions
|
@ -781,14 +781,20 @@ impl Item for BufferDiagnosticsEditor {
|
||||||
}
|
}
|
||||||
|
|
||||||
// Builds the content to be displayed in the tab.
|
// Builds the content to be displayed in the tab.
|
||||||
fn tab_content(&self, params: TabContentParams, _window: &Window, _app: &App) -> AnyElement {
|
fn tab_content(&self, params: TabContentParams, _window: &Window, _cx: &App) -> AnyElement {
|
||||||
let error_count = self.summary.error_count;
|
let error_count = self.summary.error_count;
|
||||||
let warning_count = self.summary.warning_count;
|
let warning_count = self.summary.warning_count;
|
||||||
let label = Label::new(self.project_path.path.to_sanitized_string());
|
let label = Label::new(
|
||||||
|
self.project_path
|
||||||
|
.path
|
||||||
|
.file_name()
|
||||||
|
.map(|f| f.to_sanitized_string())
|
||||||
|
.unwrap_or_else(|| self.project_path.path.to_sanitized_string()),
|
||||||
|
);
|
||||||
|
|
||||||
h_flex()
|
h_flex()
|
||||||
.gap_1()
|
.gap_1()
|
||||||
.child(label.color(params.text_color()))
|
.child(label)
|
||||||
.when(error_count == 0 && warning_count == 0, |parent| {
|
.when(error_count == 0 && warning_count == 0, |parent| {
|
||||||
parent.child(
|
parent.child(
|
||||||
h_flex()
|
h_flex()
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue