Fix Autosave "changed by another application " Spam #2072
Merged
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
Fixes an issue where a file save would not correctly update the
CodeFileDocument
's metadata when saving. This caused scheduled autosave operations to fail with a false positive 'changed by another application' error.To fix, I'm allowing
NSDocument
to handle the actual file system operation, rather than writing the data like we were before. I've kept the extra logic in the overriddensave
method to fix broken directories. There's no good reason to move the file saving operation out ofNSDocument
, since that subclass likely handles it better than we do with an atomic data write.I've also moved autosave scheduling out of UI and into the document class.
Related Issues
Checklist
Screenshots
N/A