Don't save deleted files (#24171)

We now treat new files that have no content as not-dirty. This fixes the
git diff view when deleted files are present.

It also fixes a long-standing bug where `zed RAEDME` and then closing
the tab would prompt for "unsaved changes" when there were none.

Release Notes:

- Fixed a bug where closing an empty, named, file would warn about
unsaved content.
This commit is contained in:
Conrad Irwin 2025-02-03 23:31:34 -07:00 committed by GitHub
parent 66e0898425
commit 9a22ef2fd5
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 13 additions and 8 deletions

View file

@ -27,7 +27,7 @@ use workspace::{
use crate::git_panel::GitPanel;
actions!(git, [ShowUncommittedChanges]);
actions!(git, [Diff]);
pub(crate) struct ProjectDiff {
multibuffer: Entity<MultiBuffer>,
@ -63,7 +63,7 @@ impl ProjectDiff {
fn deploy(
workspace: &mut Workspace,
_: &ShowUncommittedChanges,
_: &Diff,
window: &mut Window,
cx: &mut Context<Workspace>,
) {