Multi-cursor select navigation implementation review

check the docs in @docs and check the current state of the codebase, lets cleanup old stuff from the roadmap, update changelog, and figure out what is missing in our multi cursor select and navigation imeplementation, i see we cannot move them all at the same time, but they will insert chars on each cursor etc, consult oracle and use searcher agent to investigate and make a concrete action plan on getting the multi-cursor features mostly finished

Here's the summary of what was done:

Summary

Multi-Cursor Movement Gap Identified

Root cause: All movement handlers use cursor_mut() which always returns &mut cursors[0] (primary cursor only). Multi-cursor editing works (insert/delete), but movement doesn't.

Created Implementation Plan

feature/MULTI_CURSOR_MOVEMENT.md with 5 phases:

Phase Description Effort
0 Per-cursor primitives (move_cursor_*_at(idx)) Low
1 All-cursors wrappers (move_all_cursors_*()) Low
2 Update movement handlers in update.rs Medium
3 Selection movement helpers (*_with_selection) Low
4 Update Shift+Arrow handlers Low
5 Per-line whitespace helpers Low

Total effort: ~1-3 hours

Docs Cleaned Up

  • ROADMAP.md: Reorganized with "In Progress" section for multi-cursor movement, removed verbose completed items
  • CHANGELOG.md: Added entry documenting the identified gap and plan

Key Implementation Points

  1. Add index-based helpers to EditorState: move_cursor_left_at(doc, idx)
  2. Add all-cursors wrappers: move_all_cursors_left(doc) that iterate + deduplicate
  3. Update each MoveCursor* handler to use new methods
  4. Add selection variants for Shift+movement
  5. Every multi-cursor operation ends with deduplicate_cursors()
lets start implementing

Summary

Multi-cursor movement is now fully implemented:

Changes Made

src/model/editor.rs - Added ~400 lines:

  • Per-cursor primitives: move_cursor_left_at(), move_cursor_right_at(), move_cursor_up_at(), move_cursor_down_at(), move_cursor_line_start_at(), move_cursor_line_end_at(), move_cursor_document_start_at(), move_cursor_document_end_at(), move_cursor_word_left_at(), move_cursor_word_right_at(), page_up_at(), page_down_at()
  • All-cursors wrappers: move_all_cursors_*() for each primitive
  • Selection variants: move_all_cursors_*_with_selection() for Shift+movement

src/update.rs - Refactored handlers:

  • All MoveCursor* handlers now use new all-cursors methods
  • Removed ~125 lines of legacy single-cursor movement functions
  • Cleaner code with scoped borrows

tests/cursor_movement.rs - 10 new tests:

  • test_multi_cursor_arrow_left_moves_all
  • test_multi_cursor_arrow_right_moves_all
  • test_multi_cursor_arrow_up_moves_all
  • test_multi_cursor_arrow_down_moves_all
  • test_multi_cursor_movement_deduplicates_on_collision
  • test_multi_cursor_home_moves_all
  • test_multi_cursor_end_moves_all
  • test_multi_cursor_word_right_moves_all
  • test_multi_cursor_selection_extends_all
  • test_multi_cursor_vertical_preserves_desired_column

Test count: 383 total (was 351)

whats next?

Here are the planned features in priority order:

Feature Complexity Description
Expand/Shrink Selection Small Option+Up/Down to expand word→line→all, with history stack
File Dropping Medium Drag-and-drop files onto window to open them
Workspace Management Large CLI args (red file1 file2), file tree sidebar, FS watching
Codebase Organization Medium Split main.rs (3100 lines) and update.rs (2800 lines) into modules
Undo Coalescing Small Group rapid keystrokes into single undo entries

Deferred items (from Split View):

  • Splitter drag resize
  • Tab drag-and-drop between groups
  • Cursor adjustment when other views edit same document

Which would you like to tackle next?

check if they are actually implemeneted or not (check the code to see if its already implemented) and update changelog/roadmap if outdated.
Explored 1 file, 3 searches

Found that Expand/Shrink Selection is already implemented! Let me verify it's complete and check the other items:

Explored 2 files, 1 search

Expand/Shrink Selection is fully implemented! It has:

  • Messages (ExpandSelection, ShrinkSelection)
  • Handlers with selection history stack
  • Keyboard bindings (Option+Up/Down)

Let me check if there are tests for it and then update the docs:

Explored 1 search

There are tests too! Let me count them:

Explored 1 search

Expand/Shrink Selection is fully implemented with 18 tests! Now let me update the ROADMAP and CHANGELOG:

Edited ROADMAP.md
+11
-11

Now let me update the CHANGELOG to add the Expand/Shrink Selection feature:

Edited CHANGELOG.md
+11

Now let me update the feature design doc to mark it as complete:

Explored 1 file
Edited TEXT-SHRINK-EXPAND-SELECTION.md
+3

Now let me verify the build still works:

$ cargo build 2>&1 | tail -5

Summary

Updated docs to reflect that Expand/Shrink Selection was already implemented:

Features Already Complete (docs now updated)

Feature Tests Keybindings
Expand/Shrink Selection 18 tests Option+Up/Down
Multi-Cursor Movement 10 tests Arrow keys, Home/End, etc.

Still Planned

Feature Description
File Dropping Drag-and-drop files onto window
Workspace Management CLI args, file tree sidebar, FS watching
Codebase Organization Split main.rs (3108 lines) and update.rs (2977 lines)
Undo Coalescing Group rapid keystrokes into single undo

Deferred (from Split View)

  • Splitter drag resize
  • Tab drag-and-drop
  • Cursor adjustment when other views edit same document