cursorless-dev / cursorless

Don't let the cursor slow you down
https://www.cursorless.org/
MIT License
1.09k stars 77 forks source link

Add `cursorless_create_destination` action to talon api #2402

Closed pokey closed 4 weeks ago

pokey commented 1 month ago

This came up during a pairing session. I wanted to do something like:

transform <user.cursorless_target>:
    old = user.cursorless_get_text(cursorless_target, 1)
    new = some_transformation(old)
    destination = user.cursorless_create_destination(cursorless_target)
    user.cursorless_insert(destination, new)

Notice I can't use our existing user.cursorless_insert out of the box because it expects a destination, so we need a way to make a destination from a target

Checklist

pokey commented 1 month ago

This still needs tests and docs, but I wanted to get your thoughts first @AndreasArvidsson

AndreasArvidsson commented 1 month ago

I wanted the same.

Couldn't insert just accept a destination or target instead? Is it really simpler with another action?

pokey commented 1 month ago

Oh that's an interesting idea. Slightly mixed feelings as it might cause people to conflate target and destination, but could be simpler. I don't have a strong feeling. Maybe let's discuss tomorrow?

AndreasArvidsson commented 1 month ago

Yup

pokey commented 4 weeks ago

update from meet-up:

pokey commented 4 weeks ago

ok @AndreasArvidsson this one is good to go

pokey commented 4 weeks ago

wait one sec i'll add release notes

pokey commented 4 weeks ago

ok good to go

jaresty commented 4 weeks ago

This rings a bell for me too. Great idea!

pokey commented 4 weeks ago

ok @AndreasArvidsson feedback addressed