autosave: Respect project autosave settings per file (#13369)
This fixes #13316 by checking whether there are any local workspace settings for a given file. Release Notes: - Fixed `autosave` settings in project-specific settings file being ignored. ([#13316](https://github.com/zed-industries/zed/issues/13316)). Co-authored-by: Bennet <bennet@zed.dev>
This commit is contained in:
parent
3ee3c6a3bd
commit
40748b0a15
4 changed files with 38 additions and 17 deletions
|
@ -1421,7 +1421,7 @@ impl Pane {
|
|||
if save_intent == SaveIntent::Close {
|
||||
let will_autosave = cx.update(|cx| {
|
||||
matches!(
|
||||
WorkspaceSettings::get_global(cx).autosave,
|
||||
item.workspace_settings(cx).autosave,
|
||||
AutosaveSetting::OnFocusChange | AutosaveSetting::OnWindowChange
|
||||
) && Self::can_autosave_item(item, cx)
|
||||
})?;
|
||||
|
@ -1490,13 +1490,12 @@ impl Pane {
|
|||
project: Model<Project>,
|
||||
cx: &mut WindowContext,
|
||||
) -> Task<Result<()>> {
|
||||
let format = if let AutosaveSetting::AfterDelay { .. } =
|
||||
WorkspaceSettings::get_global(cx).autosave
|
||||
{
|
||||
false
|
||||
} else {
|
||||
true
|
||||
};
|
||||
let format =
|
||||
if let AutosaveSetting::AfterDelay { .. } = item.workspace_settings(cx).autosave {
|
||||
false
|
||||
} else {
|
||||
true
|
||||
};
|
||||
if Self::can_autosave_item(item, cx) {
|
||||
item.save(format, project, cx)
|
||||
} else {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue