Skip to content

[keyboard] Better support for multi-target actions (ie "bring" / "move" / "swap") #994

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Open
13 tasks
Tracked by #989
pokey opened this issue Oct 2, 2022 · 2 comments
Open
13 tasks
Tracked by #989
Labels
enhancement New feature or request keyboard

Comments

@pokey
Copy link
Member

pokey commented Oct 2, 2022

  • Add action which creates a named mark. Like a lightweight version of Add "mark" action to bookmark a target #46. Note that we'll probably want to arrange for this action not to set the that mark, 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 the destination mark to be the current selection. Then selecting a hat will target this special destination mark instead of just the usual that mark
  • Applying a scope expansion or other modifier will target both that mark and destination mark
  • Need equivalent to just that breaks the chain, so that it doesn't target that, only destination (see also [keyboard] More advanced range / list target support #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

@pokey pokey added enhancement New feature or request good first issue Good for newcomers keyboard and removed good first issue Good for newcomers labels Oct 2, 2022
@Kn0rk
Copy link

Kn0rk commented Oct 25, 2023

Here is how the current keyboard implementation works fundamentally:

  1. A mark is selected
  2. The mark is highlighted which makes it available through that target
  3. Further modifiers or actions are then always applied as a highlighting of the that target which makes the modified target again available through that.

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?

@pokey
Copy link
Member Author

pokey commented Jun 17, 2024

  • 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"

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request keyboard
Projects
None yet
Development

No branches or pull requests

2 participants