Add auto-save preference to control document auto-save behavior#326
Merged
Conversation
2bb1235 to
8f507d8
Compare
Contributor
Code Coverage ReportCurrent Coverage: 56.42% Coverage Details (Summary) |
Adds an editorAutoSave preference (default: YES) that controls both NSDocument autosave-in-place and auto-reload behavior. When disabled, autosave-in-place is turned off and external file changes always prompt the user instead of silently reloading. Includes preference migration (version 4) to default existing users to YES, a checkbox in General preferences, and updated tests. https://claude.ai/code/session_01CZuWu6Y2w3GynDb8dZyuHs
8f507d8 to
d2e698c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
Summary
This PR adds a new
editorAutoSavepreference that allows users to control whether MacDown automatically saves and reloads documents. Previously, auto-save was always enabled. This change makes it configurable while preserving the existing behavior for current users through a migration.Key Changes
editorAutoSaveboolean property toMPPreferencesthat defaults toYESfor new and existing userseditorAutoSavedefaulted toYES, preserving their current auto-save behaviorMPDocument.autosavesInPlaceto respect the preference instead of always returningYEShandleExternalFileChangeto always prompt for reload when auto-save is disabled, giving users explicit control over external file changestestAutoSaveToggleto verify preference persistencetestAutoSaveMigrationDefaultsToYesto verify migration behaviorImplementation Details
NSUserDefaultswith keyeditorAutoSaveYESfor both new installations and users migrating from version 3