This repository was archived by the owner on Dec 15, 2022. It is now read-only.
Fix the behavior of the undo: 'skip' option#282
Merged
maxbrunsfeld merged 3 commits intomasterfrom Jan 3, 2018
Merged
Conversation
This method lets you group the last two changes that you made with respect to undo and redo. Signed-off-by: Nathan Sobo <nathan@github.com>
This changes the behavior of undo after calling .setTextInRange with
that option. Previously, the change would not be added to the undo
stack, but this lead to an inconsistent state.
Now, when undoing after calling .setTextInRange with {undo: 'skip'}, the
change is undone along with the preceding change. Hopefully, this
matches the intent of package authors using this option.
Signed-off-by: Nathan Sobo <nathan@github.com>
2 tasks
This was referenced Jan 10, 2018
dsandstrom
added a commit
to dsandstrom/atom-double-tag
that referenced
this pull request
Apr 20, 2018
The option is deprecated atom/text-buffer#282 They changed the behaviour of the undo option and it no longer works. This also broke core:redo with this package. I wasn't able to fix redo, so this commit is only a partial fix. Fixes #36
This was referenced Apr 20, 2018
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
This PR changes the behavior of undo after calling
.setTextInRangewith the{undo: 'skip'}option. Previously, the change would not be added to the undo stack, but this led to an inconsistent state.Now, when undoing after calling
.setTextInRangewith{undo: 'skip'}, the change is undone along with the preceding change. Hopefully, this matches the intent of package authors using this option.We've updated the documentation to discourage using
{undo: 'skip'}and instead to call the new method.groupLastChangesafter making the change.Fixes atom/atom#15827
🍐 'd with @nathansobo