-
Notifications
You must be signed in to change notification settings - Fork 643
Open
Labels
E-help-wantedWe encourage you to jump in on these!We encourage you to jump in on these!I-featureFeature requests and any other major tasks. Requires major work in the 1000s of LOC.Feature requests and any other major tasks. Requires major work in the 1000s of LOC.
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:
Lines 84 to 101 in b008570
/// An undo/redo entry. struct HistoryEntry { /// [`TextBuffer::cursor`] position before the change was made. cursor_before: Point, /// [`TextBuffer::selection`] before the change was made. selection_before: Option<TextBufferSelection>, /// [`TextBuffer::stats`] before the change was made. stats_before: TextBufferStatistics, /// [`GapBuffer::generation`] before the change was made. generation_before: u32, /// Logical cursor position where the change took place. /// The position is at the start of the changed range. cursor: Point, /// Text that was deleted from the buffer. deleted: Vec<u8>, /// Text that was added to the buffer. added: Vec<u8>, } - Splitting the singular cursor into a main cursor and a secondary cursor list (which could also include the main cursor?):
Line 186 in b008570
cursor: Cursor, - Centralizing / abstracting the various cursor movement functions within the same file
- ...and making all cursors move when the main cursor moves
- Updating
write(),delete()andunindent()accordingly.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
E-help-wantedWe encourage you to jump in on these!We encourage you to jump in on these!I-featureFeature requests and any other major tasks. Requires major work in the 1000s of LOC.Feature requests and any other major tasks. Requires major work in the 1000s of LOC.