feat: multi-cursor editing#14
Merged
Merged
Conversation
Add full multi-cursor support: select next/all occurrences, add cursors via Alt+Click, type/delete/enter at all cursors simultaneously with single-step undo via BatchCommand grouping. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
aed3a55 to
a70545b
Compare
Two bugs prevented multi-cursor edits from working: 1. syncTabs() in Render() overwrote Editor.Multi on every redraw, losing cursor state set by SelectNextOccurrence(). Fixed by saving Multi back to the tab after mutations and after HandleEvent. 2. Cursor position adjustments went the wrong direction — adjusting unprocessed cursors (earlier positions) instead of already-processed ones (later positions). Rewrote adjust helpers to fix later-index cursors after each edit in the right-to-left loop. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Use reverse style for all cursor positions so they appear as solid blocks of the editor foreground color. Hide the hardware cursor when multi-cursor is active so all cursors render uniformly. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
Update README and docs-web with multi-cursor keybindings and behavior: Ctrl+D, Ctrl+K L, Alt+Click, Ctrl+K U, Escape. 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
New files
internal/core/multicursor/multicursor.go— MultiCursor data structureinternal/core/multicursor/multicursor_test.go— unit testsinternal/core/undo/undo_test.go— BatchCommand testsTest plan
go test ./...— all 22 packages passmake build— clean build🤖 Generated with Claude Code