Skip to content
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

Fluent chaining after a "bring" / "move" #414

Open
3 tasks
pokey opened this issue Dec 24, 2021 · 0 comments
Open
3 tasks

Fluent chaining after a "bring" / "move" #414

pokey opened this issue Dec 24, 2021 · 0 comments
Labels
enhancement New feature or request

Comments

@pokey
Copy link
Member

pokey commented Dec 24, 2021

The problem

Today, it is difficult / impossible to issue a single command phrase in which a "bring" / "move" command is followed by a command that modifies the newly copied / moved target, because the new text won't contain any hats until after the phrase has ended. We'd like to remove this limitation, enabling more fluent coding with longer command chains

Here's an example:

function foo() {
   |
}

const bar = baz("bongo")

In the above, our cursor is in the function foo, and we'd like to move the statement declaring bar to our cursor location, fluently changing the function call argument to be hello. Here's the desired end state:

function foo() {
   const bar = baz(hello)
}

Possible solutions

These solutions are not mutually exclusive; it is better to have multiple ways to accomplish this task so that the user / situation can determine the best approach. For each approach, we indicate at the end the exact command phrase that the user could issue to accomplish the above example.

Option 1: Hat migration [yes]

  • Automatically move the hats from the source to the target immediately after a "bring" / "move". This approach would result in a single hat corresponding to multiple locations in the case of a single-source-multiple-destination broadcast move (eg "bring funk air to after bat and cap")
    • We could create an alternate term for the source hats as well, eg "source gust", etc
    • Alternately we could leave the old hats and have the new ones be called "that gust" or "new gust"

Example: "move state zip clear arg gust word hello"

Note: This behaviour already occurs with "clone"

Tracker issue:

Option 2: "taking" [no]

  • Add an optional clause at the end of "bring" / "move" called "taking" which moves the selection to the corresponding piece of the new target. So if you say "bring funk air taking arg bat", it would create a copy of the function, selecting the argument in the new target corresponding to the argument "bat" in the source

Example: "move state zip taking arg gust word hello"

Option 3: Selection migration [yes]

  • Make it so that if the user has selection(s) within the source, the selections will be moved to the corresponding place in the new target, similar to how we do for "clone"

Example: "take arg gust move state back word hello"

Tracker issue:

Option 4: Relative scopes [yes]

Example: "move state zip clear next arg word hello"

Tracker issue:

@pokey pokey added the enhancement New feature or request label Dec 24, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant