Conversation
Implement undo/redo with Ctrl+Z / Ctrl+Shift+Z (or Ctrl+Y) in the query editor. Uses snapshot-based undo with intelligent grouping: consecutive character inserts/deletes are grouped into single undo units, while newlines, paste, and selection operations create separate undo points. Max undo depth is 500 operations. - Added UndoHistory with snapshot-based undo/redo stacks - Consecutive same-type edits (insert/delete) are grouped - Newlines, paste, cut, and selection deletes create new groups - set_text() and clear() reset undo history - Cursor position is restored on undo/redo - 13 new unit tests for undo/redo behavior - Help overlay updated with new keybindings Closes #15 Co-Authored-By: Claude Opus 4.6 <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.
Summary
Implements full undo/redo functionality for the SQL editor, addressing #15.
set_text()andclear()reset undo history (loading from history/clearing editor starts fresh)Edit Grouping Rules
Changes
src/editor/buffer.rsUndoHistory,BufferSnapshot,UndoActionType;save_undo(),undo(),redo()methods; integrated undo recording into all mutation methodssrc/ui/app.rssrc/ui/components.rsTest plan
cargo fmtcleanCloses #15
🤖 Generated with Claude Code