Fix persistence of Substitutions and Spelling settings#252
Merged
Conversation
Remove hardcoded XIB defaults (dashSubstitution, smartInsertDelete) that were overriding NSUserDefaults values on document load. Add missing smartInsertDeleteEnabled key to MPEditorKeysToObserve() so Smart Copy/Paste setting is now saved and restored like other substitution settings. Related to #250
Contributor
Code Coverage ReportCurrent Coverage: 51.40% Coverage Details (Summary) |
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
Fixes persistence bugs for Edit → Substitutions and Edit → Spelling and Grammar settings that were preventing them from being saved across application launches.
Changes:
dashSubstitution="YES" smartInsertDelete="YES") that were overriding NSUserDefaults valuessmartInsertDeleteEnabledkey toMPEditorKeysToObserve()so Smart Copy/Paste is now saved/restored like other settingsBehavior change: All substitution and spelling/grammar settings now default to OFF on fresh install (previously Smart Dashes and Smart Copy/Paste defaulted to ON from XIB).
Related Issue
Related to #250
Manual Testing Plan
Prerequisites
Key Test Scenarios
Verify Default State - All 8 settings should be OFF on fresh install (after
defaults delete com.macdown.MacDown)Smart Copy/Paste Persistence - Enable via Edit → Substitutions → Smart Copy/Paste, quit, relaunch - setting should remain checked
Smart Dashes Persistence - Enable via Edit → Substitutions → Smart Dashes, type
--, quit, relaunch - setting should persist and dashes should still convertToggle OFF Persistence - Enable a setting, quit/relaunch, disable it, quit/relaunch - should remain OFF
Multi-Document - Settings apply globally to all documents (not per-document)
Settings to Test
Review Notes