ulyssa / modalkit

A Rust library for building modal editing applications
Apache License 2.0
49 stars 5 forks source link

Support jumplist and changelist #35

Closed ulyssa closed 1 year ago

ulyssa commented 1 year ago

There are types for moving around the jumplist and changelist (Action::Jump, PositionList::ChangeList, PositionList::JumpList), but nothing to consume them at the moment.

ulyssa commented 1 year ago

In order to easily save the current positions of all members of the cursor group, I'm going to get rid of all the different hash maps (vshapes, cursors, anchors, leaders, and members), and just have one map that points at a single struct, CursorGroup, which has the whole group state, including current selections.

This will make it easier to have a the lists track them, and will also make it easier to implement Kakoune's z and Z keys for saving and restoring cursor group state. The CursorGroup will also take care of combining two cursor groups when using Kakoune's <Alt-z>/<Alt-Z>.