feat: add mergeImeCompositionHistory config to group IME intermediate states in undo stack#2723
Open
nandin9 wants to merge 1 commit intosingerdmx:masterfrom
Open
feat: add mergeImeCompositionHistory config to group IME intermediate states in undo stack#2723nandin9 wants to merge 1 commit intosingerdmx:masterfrom
nandin9 wants to merge 1 commit intosingerdmx:masterfrom
Conversation
… states in undo stack
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.
Description
Currently, when users type using an Input Method Editor (IME) like Chinese Pinyin or Japanese, every intermediate keystroke (composing state) is recorded as a separate step in the
Historyundo stack. This leads to a broken undo/redo experience where pressingCmd+ZorCtrl+Zundoes individual pinyin letters instead of the final committed word.This PR introduces a new configurable feature to group these IME composition states into a single, clean undo step.
Changes Made
mergeImeCompositionHistoryinQuillEditorConfig: A new boolean flag (defaulting totrue) allowing developers to control this IME history merging behavior.forceMergeNextinHistory: A new setter in the bottom-layerHistoryclass. It utilizes Dart'sFuture.microtaskto automatically and safely reset its state after the current synchronous event loop, ensuring no state leakage to subsequent regular key presses.updateEditingValueinRawEditorState: Reads theisComposingstate fromTextEditingValueand flags the history stack to merge the upcoming delta if the previous state was composing.Visual Proof (Before & After)
video-1774413039976.mp4
video-1774412915619.mp4
Type of Change