Option to auto-close deleted files with no unsaved edits (#31920)

Closes #27982

Release Notes:

- Added `close_on_file_delete` setting (off by default) to allow closing
open files after they have been deleted on disk

---------

Co-authored-by: Bennet Bo Fenner <bennetbo@gmx.de>
This commit is contained in:
Ben Brandt 2025-06-03 13:18:29 +02:00 committed by GitHub
parent 3077abf9cf
commit b74477d12e
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
6 changed files with 393 additions and 5 deletions

View file

@ -26,6 +26,7 @@ pub struct WorkspaceSettings {
pub max_tabs: Option<NonZeroUsize>,
pub when_closing_with_no_tabs: CloseWindowWhenNoItems,
pub on_last_window_closed: OnLastWindowClosed,
pub close_on_file_delete: bool,
}
#[derive(Copy, Clone, Default, Serialize, Deserialize, JsonSchema)]
@ -197,6 +198,10 @@ pub struct WorkspaceSettingsContent {
///
/// Default: auto (nothing on macOS, "app quit" otherwise)
pub on_last_window_closed: Option<OnLastWindowClosed>,
/// Whether to automatically close files that have been deleted on disk.
///
/// Default: false
pub close_on_file_delete: Option<bool>,
}
#[derive(Deserialize)]