Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Require save confirmation and prevent autosave for deleted files #20742

Merged
merged 1 commit into from
Nov 15, 2024

Conversation

mgsloan
Copy link
Contributor

@mgsloan mgsloan commented Nov 15, 2024

  • has_conflict will now return true if the file has been deleted on
    disk. This is for treating multi-buffers as conflicted, and also
    blocks auto-save.

  • has_deleted_file is added so that the single-file buffer save can
    specifically mention the delete conflict. This does not yet handle
    discard (Implement discarding save conflicts for externally deleted files #20745).

Closes #9101
Closes #9568
Closes #20462

Release Notes:

  • Improved handling of externally deleted files: auto-save will be disabled, multibuffers will treat this as a save conflict, and single buffers will ask for restore confirmation.

@cla-bot cla-bot bot added the cla-signed The user has signed the Contributor License Agreement label Nov 15, 2024
@mgsloan mgsloan force-pushed the confirm-save-for-deleted-files branch 2 times, most recently from be9b0f3 to 05fd052 Compare November 15, 2024 20:20
@mgsloan mgsloan force-pushed the confirm-save-for-deleted-files branch 2 times, most recently from 58cd2b7 to ffcbb0b Compare November 15, 2024 20:32
@mgsloan mgsloan force-pushed the confirm-save-for-deleted-files branch 2 times, most recently from b3bd3b1 to 0355c0c Compare November 15, 2024 21:51
@mgsloan mgsloan changed the title Require confirmation when saving with deleted files Require save confirmation and prevent autosave for deleted files Nov 15, 2024
* `has_conflict` will now return true if the file has been deleted on
disk.  This is for treating multi-buffers as conflicted, and also
blocks auto-save.

* `has_deleted_file` is added so that the single-file buffer save can
specifically mention the delete conflict. This does not yet handle
discard (#20745).

Co-authored-by: Conrad <conrad@zed.dev>
@mgsloan mgsloan force-pushed the confirm-save-for-deleted-files branch from 0355c0c to a9b0175 Compare November 15, 2024 22:00
@mgsloan mgsloan merged commit 369828f into main Nov 15, 2024
2 checks passed
@mgsloan mgsloan deleted the confirm-save-for-deleted-files branch November 15, 2024 22:01
ConradIrwin added a commit that referenced this pull request Dec 3, 2024
In #20742 we added a call to remove_item that retain an item index over
an
await point. This led to a race condition that could panic if another
tab was
removed during that time. (cc @mgsloan)

This changes the API to make it harder to misuse.

Release Notes:

- Fixed a panic when closing tabs containing new unsaved files
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
cla-signed The user has signed the Contributor License Agreement
Projects
None yet
1 participant