Skip to content

Commit 6150aea

Browse files
Support "bring" in custom api (#1226)
Enables things like: ```talon foo bar <user.cursorless_target>: some.stuff() user.cursorless_command("replaceWithTarget", cursorless_target) other.stuff() ``` ## Checklist - [ ] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [ ] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) - [ ] I have not broken the cheatsheet Co-authored-by: Andreas Arvidsson <[email protected]>
1 parent a07b016 commit 6150aea

File tree

1 file changed

+5
-0
lines changed

1 file changed

+5
-0
lines changed

src/actions/actions.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
from talon import Module, actions, app
22

33
from ..csv_overrides import init_csv_and_watch_changes
4+
from ..primitive_target import IMPLICIT_TARGET
45
from .actions_callback import callback_action_defaults, callback_action_map
56
from .actions_custom import custom_action_defaults
67
from .actions_simple import (
@@ -43,6 +44,10 @@ def cursorless_command(action_id: str, target: dict):
4344
actions.user.cursorless_single_target_command_no_wait(action_id, target)
4445
if action_id in no_wait_actions_post_sleep:
4546
actions.sleep(no_wait_actions_post_sleep[action_id])
47+
elif action_id in ["replaceWithTarget", "moveToTarget"]:
48+
actions.user.cursorless_multiple_target_command(
49+
action_id, [target, IMPLICIT_TARGET.copy()]
50+
)
4651
else:
4752
return actions.user.cursorless_single_target_command(action_id, target)
4853

0 commit comments

Comments
 (0)