Stop auto-merge folding an edit into a saved command - #85
Merged
Merged
Conversation
The first mergeable edit after MarkAsSaved merged into the saved command, and CleanupInvalidBoundaries then dropped the boundary, so Undo could never return to the saved state. Skip merging when a save boundary sits at the current position. Fixes #84 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016ToeUpj3nH61YEnatKdb8d
|
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.



Fixes #84
What was wrong
UndoRedoService.Executemerged the first mergeable edit afterMarkAsSaved()into the saved command.CleanupInvalidBoundariesthen removed the save boundary, so Undo skipped past the saved state and the stack reported unsaved changes at every position.Change
IsAtSaveBoundaryhelper, so there is no public API change.CommandMerging_AfterMarkAsSaved_KeepsTheSaveBoundaryis the issue's repro. It expects two commands and one boundary,'a'after Undo, and a clean stack.CommandMerging_AfterMarkAsSaved_MergesLaterEditsWithEachOthershows that edits made after the save still merge with each other.Verification
🤖 Generated with Claude Code
https://claude.ai/code/session_016ToeUpj3nH61YEnatKdb8d
Generated by Claude Code