Skip to content

Enhance deleted state#13

Open
savetheclocktower wants to merge 2 commits intomasterfrom
enhance-deleted-state
Open

Enhance deleted state#13
savetheclocktower wants to merge 2 commits intomasterfrom
enhance-deleted-state

Conversation

@savetheclocktower
Copy link
Copy Markdown

@savetheclocktower savetheclocktower commented Mar 27, 2026

Issue or RFC Endorsed by Atom's Maintainers

#12

Description of the Change

This improves handling of a “deleted” buffer state as follows:

  • Distinguishes it from buffers that never had a backing file on disk; isDeleted is now a state that can be queried just like isModified or isInConflict.
  • Changes isModified so that it no longer automatically returns true if the buffer's file doesn't exist. Instead, it returns false if the buffer was unmodified at time of deletion, as long as no subsequent edits have been made. Otherwise, it returns true in all scenarios in which it would've previously returned true.

This allows us to get closer to VS Code's behavior with deleted files: allow the user to remove their tab (representing a file that was deleted) from the workspace without an unnecessary “are you sure?” prompt.

Alternate Designs

#12 outlines the two possible designs. I went with the first one because it's more elegant.

Possible Drawbacks

There could be unintended side effects of narrowing the definition of isModified for one specific kind of pane item. I haven't found any yet, but we should keep an eye on this.

Verification Process

New unit tests.

Release Notes

  • [text-buffer] Enhance “deleted” state to distinguish whether the buffer was in a modified state during time of file deletion.

@savetheclocktower savetheclocktower marked this pull request as ready for review April 4, 2026 18:36
@savetheclocktower
Copy link
Copy Markdown
Author

#11 landed, so this can come out of draft.

I'm not aiming for 1.132 on this one; probably 1.133 if the first phase (conflict detection) goes smoothly. So this isn't urgent!

@savetheclocktower savetheclocktower linked an issue Apr 4, 2026 that may be closed by this pull request
1 task
@savetheclocktower savetheclocktower added the enhancement New feature or request label Apr 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

enhancement New feature or request

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Promote “deleted” into its own state

1 participant