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:
parent
3077abf9cf
commit
b74477d12e
6 changed files with 393 additions and 5 deletions
|
@ -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)]
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue