Repository navigation
feat: undo and redo many steps in Windows 10 Notepad (0.4.1) - #2
Merged
Merged
Conversation
Notepad's edit control keeps one undo step, and a second control+Z redoes it. Code Compass now records the document at undo stops (a pause in typing, a caret move to another line, a save, and before and after each of its own commands), keeping only what changed, and control+Z, control+Y and control+shift+Z walk through those steps. Typing edits such as auto-close and indentation join the typing around them. A new document in the window (another title, or a changed text that Notepad reports as unmodified) starts a new history, so undo never brings back another file's text. Undoing back to the saved text clears the "*". On by default; a setting turns it off. Version 0.4.1. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Review fixes for the many-step undo: - A document replaced through File > Open or File > New (Notepad calls it unchanged) starts a new history when the editor gets focus and before undo or redo, so control+Z never brings back the previous file's text. A save under a new name keeps the history only for that very text, and the save's note is dropped once the save is handled. - Histories belong to Notepad's own top-level window and title, not to the window in front (Find, Save As, another program) or to the edit control, which Word Wrap replaces. - The history starts when the editor gets focus, so the first typing in a document can be undone. - The common start and end of two texts are found block by block, so a step in a large file costs little. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
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.
Windows 10's Notepad keeps a single undo step, and its second control+Z redoes it. This adds many-step undo and redo, like VS Code:
Implementation:
undo.py(no NVDA imports) keeps only the changed part between stops; the plugin records stops on typing pauses, line moves, saves and around its own commands, and applies steps withedit_control.replace.Checked by a two-agent review with adversarial verification; its 8 findings are fixed in the second commit, with tests. 499 tests pass. Merging publishes 0.4.1 (
buildVars.pyandCHANGELOG.mdupdated).🤖 Generated with Claude Code