cursorless
cursorless copied to clipboard
[keyboard] Better support for multi-target actions (ie "bring" / "move" / "swap")
- [ ] Add action which creates a named mark. Like a lightweight version of #46. Note that we'll probably want to arrange for this action not to set the
thatmark, because we'll want to keep that unchanged - [ ] Add a keyboard shortcut that switches the action to use this new create named mark action, and create a mark called
destination. This keyboard shortcut will by default set thedestinationmark to be the current selection. Then selecting a hat will target this specialdestinationmark instead of just the usualthatmark - [ ] Applying a scope expansion or other modifier will target both
thatmark anddestinationmark - [ ] Need equivalent to
justthat breaks the chain, so that it doesn't targetthat, onlydestination(see also #1004) - [ ] Need to figure out how to highlight this mark in a different color
- [ ] Then have set of actions for the following:
- [ ] "move after"
- [ ] "move before"
- [ ] "move to"
- [ ] "bring after"
- [ ] "bring before"
- [ ] "bring to"
- [ ] "swap"
Btw this kind of jives with an idea @AndreasArvidsson and I were talking about, where you have one target with named attributes instead of a list of targets.
Feels like this moves towards a viewpoint that Cursorless is really allowing us to have named / differentiated cursors
Here is how the current keyboard implementation works fundamentally:
- A mark is selected
- The mark is highlighted which makes it available through
thattarget - Further modifiers or actions are then always applied as a highlighting of the
thattarget which makes the modified target again available throughthat.
In my experiment #1964 I do not use the that mark to chain modifiers. Instead I manually track and extend/modify every target in a list of targets. This opens the possibility to have an keyboard action like designate last target in list as destination. Or a toggle that allows the user to set the destination target explicitly. Any 2-target actions would either use cursor if the destination target is null or use the destination target if it is set.
This basically moves the proposed feature #46 into the keyboard mode only.
Having a list of targets gives more flexibility to the keyboard mode implementation. However, I am not familiar enough with more advanced features (e.g. experimental.setInstanceReference) to figure out if that flexibility is actually helpful or just unnecessary complexity. For example: can we apply a experimental.setInstanceReference to a that target?
- Would maybe be some kind of special target
- Would need to figure out how to make "inference" work, ie you set source then destination then if you run a modifier it modifies them all
- Need to think about interaction with some kind of "just"