Repository navigation
Keep undo history separate for each language - #456
Open
Chingyong0905 wants to merge 1 commit into
Open
Chingyong0905 wants to merge 1 commit into
Chingyong0905 wants to merge 1 commit into
Conversation
Chingyong0905
force-pushed
the
fix-language-undo-v4
branch
from
October 23, 2026 16:30
82aa49a to
5b06fd3
Compare
ColtenOuO
reviewed
Oct 23, 2026
jserv
reviewed
Oct 23, 2026
Chingyong0905
force-pushed
the
fix-language-undo-v4
branch
from
October 24, 2026 08:24
5b06fd3 to
89fd40e
Compare
jserv
reviewed
Oct 24, 2026
jserv
requested changes
Oct 24, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Before asking someone to review, you MUST resolve any regressions flagged by GitHub Actions.
jserv
reviewed
Oct 24, 2026
jserv
requested changes
Oct 24, 2026
jserv
left a comment
Contributor
There was a problem hiding this comment.
Rebase latest main branch and resolve conflicts.
Keep editor history per language so Undo cannot replay another buffer.
Chingyong0905
force-pushed
the
fix-language-undo-v4
branch
from
October 24, 2026 17:59
89fd40e to
88ce69c
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.
Switching languages can make Undo restore another language's deleted text. Keep up to 200 edits per language for Python, JavaScript, C, C++ and Java. Language switches record no edit and restore the selected language's buffer and history.
Typing, paste, cut, drop, composition, indentation, bracket edits, comment toggling and starter restores use the page history. Undo and redo restore the selection bounds and direction. Programmatic edits assign the buffer directly and use the existing input path for painting, replay and code_update. Restore works on the first press, including without native editing commands; the old confirmation and newline workaround are removed.
Whitespace separates typing groups. History notifications during IME composition remain with the input method; the committed composition is one edit. The tests cover both composition history input types and both cancelable and input-only history paths.
Rebased onto
mainat7c50276. All 351 related tests pass locally with no skips. Commit88ce69cpasses the browser, portable, Rust and audit checks in [upstream CI](https://github.com/sysprog21/codetrial/actions/runs/40118611094). The IME checks use synthetic events.Native Edit/context-menu availability still follows the browser's own history. Cancelable history events are intercepted; input-only notifications are repaired afterward. This does not guarantee that native undo never executes or that native Redo is enabled.
Python after Undo: BBB is restored.
JavaScript after Undo: 222 is restored.
Closes #365