From f34877334e976319a712aa590f4ed00b0fffbf3b Mon Sep 17 00:00:00 2001 From: Michael Sloan Date: Fri, 15 Nov 2024 17:14:49 -0700 Subject: [PATCH] Fix tab strikethrough logic (#20755) This fix was in downstream commits before splitting out #20711, should have tested locally before merging. Release Notes: - N/A --- crates/editor/src/items.rs | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/crates/editor/src/items.rs b/crates/editor/src/items.rs index 8057daafa5..fb26a5654b 100644 --- a/crates/editor/src/items.rs +++ b/crates/editor/src/items.rs @@ -635,12 +635,13 @@ impl Item for Editor { Some(util::truncate_and_trailoff(description, MAX_TAB_TITLE_LEN)) }); - let is_deleted: bool = self + // Whether the file was saved in the past but is now deleted. + let was_deleted: bool = self .buffer() .read(cx) .as_singleton() .and_then(|buffer| buffer.read(cx).file()) - .map_or(true, |file| file.is_deleted()); + .map_or(false, |file| file.is_deleted() && file.is_created()); h_flex() .gap_2() @@ -648,7 +649,7 @@ impl Item for Editor { Label::new(self.title(cx).to_string()) .color(label_color) .italic(params.preview) - .strikethrough(is_deleted), + .strikethrough(was_deleted), ) .when_some(description, |this, description| { this.child(