Autosave files on close, when setting is afterDelay (#36929)
Closes https://github.com/zed-industries/zed/issues/12149 Closes #35524 Release Notes: - Improved autosave behavior, to prevent a confirmation dialog when quickly closing files and using the `afterDelay` setting --------- Co-authored-by: MrSubidubi <finn@zed.dev>
This commit is contained in:
@@ -254,6 +254,17 @@ pub enum AutosaveSetting {
|
||||
OnWindowChange,
|
||||
}
|
||||
|
||||
impl AutosaveSetting {
|
||||
pub fn should_save_on_close(&self) -> bool {
|
||||
matches!(
|
||||
&self,
|
||||
AutosaveSetting::OnFocusChange
|
||||
| AutosaveSetting::OnWindowChange
|
||||
| AutosaveSetting::AfterDelay { .. }
|
||||
)
|
||||
}
|
||||
}
|
||||
|
||||
#[derive(Copy, Clone, Debug, Serialize, Deserialize, PartialEq, Eq, JsonSchema)]
|
||||
#[serde(rename_all = "snake_case")]
|
||||
pub enum PaneSplitDirectionHorizontal {
|
||||
|
||||
Reference in New Issue
Block a user