Skip to content

Commit

Permalink
Fix tab strikethrough logic (#20755)
Browse files Browse the repository at this point in the history
This fix was in downstream commits before splitting out #20711, should
have tested locally before merging.

Release Notes:

- N/A
  • Loading branch information
mgsloan authored Nov 16, 2024
1 parent 6e296eb commit f348773
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions crates/editor/src/items.rs
Original file line number Diff line number Diff line change
Expand Up @@ -635,20 +635,21 @@ 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()
.child(
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(
Expand Down

0 comments on commit f348773

Please sign in to comment.