microsoft / microsoft/edit

Add support for multiple cursors

Open
#24 0 comments 7 reactions 0 assignees View on GitHub
C-feature E-help-wanted
Dominant language
Rust
Stars
14.6k
Forks
734
Avg merge
8h 40m
Merged PRs (30d)
4

Description

We should add support for multiple cursors because they're widely used and useful. Default shortcuts should be:
* Ctrl+Alt+Up/Down for duplicating the cursor above/below
* Ctrl+D for finding the next occurrence of the current selection and adding a cursor there

This requires:
* Extending the history entry: https://github.com/microsoft/edit/blob/b008570afc0c4c6cef7ba0335d407139a47c8e24/src/buffer/mod.rs#L84-L101
* Splitting the singular cursor into a main cursor and a secondary cursor list (which could also include the main cursor?): https://github.com/microsoft/edit/blob/b008570afc0c4c6cef7ba0335d407139a47c8e24/src/buffer/mod.rs#L186
* Centralizing / abstracting the various cursor movement functions within the same file
* ...and making all cursors move when the main cursor moves
* Updating `write()`, `delete()` and `unindent()` accordingly.

Contributor guide

Open the contributing guide

Research direction

Start in src/buffer/mod.rs at the history entry and cursor definitions referenced in the issue, then trace the cursor movement functions and the write(), delete(), and unindent() paths. Done means supporting the listed Ctrl+Alt+Up/Down and Ctrl+D shortcuts, recording multiple cursors in history, and applying movement and editing operations to all cursors.

Written by the indexing model from the issue text.

Assessment

Tech stack
rust
Domain
cli
Issue type
Feature
Difficulty
5/5
Estimated time
Over a week
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
25/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.