Group text edits for undo/redo unless preview is live - #3563
Open
ethancrawford wants to merge 1 commit into
Open
Group text edits for undo/redo unless preview is live#3563ethancrawford wants to merge 1 commit into
ethancrawford wants to merge 1 commit into
Conversation
Previously, every individual keypress was treated as a separate event for undo/redo. This meant that multiple presses of the delete or backspace keys were undone/redone one at a time, which is a very slow and laborious process. Only signalling an undo action if a preview is live allows multiple normal text edits to be grouped into a single undo/redo.
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.
Previously, every individual keypress was treated as a separate event for undo/redo. This meant that multiple presses of the delete or backspace keys were undone/redone one at a time, which is a very slow and laborious process.
Only signalling an undo action if a preview is live allows multiple normal text edits to be grouped into a single undo/redo.
@samaaron I'm still in the process of understanding the v5 code, so I'd appreciate your eyes and any comments on this fix. It does appear to do what I would expect, namely allow normal text edits to be grouped in a single undo/redo action, while leaving live preview values as individual undo actions. I have tested it by doing the following:
play 60, pan:, scrolling to change the pan value a few times, and hittingEsc. Undoing cycles back through the inserted preview values and back toplay 60, pan:. Redo does the reverse.chord :C,, scrolled to change the chord name a few times, and hittingEsc. Same undo/redo behaviour as above.play, and immediately backspaced to remove it. Undo/redo restores/removes it in whole, rather than a letter at a time.# testand immediately backspaced to remove it. Same undo/redo behaviour as above.