-
-
Notifications
You must be signed in to change notification settings - Fork 91
Added destination and v6 api to Talon #1717
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
Merged
Merged
Changes from all commits
Commits
Show all changes
22 commits
Select commit
Hold shift + click to select a range
692575b
Added destination and v6 api to Talon
pokey ca339a1
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] c7c2347
Merge branch 'main' into destination-talon
AndreasArvidsson b314467
remove
AndreasArvidsson 7ed7628
modifies local link
AndreasArvidsson 260a4c2
tweak
pokey fa5a2b7
typo
pokey fdfe2f7
cheatsheet tweaks
pokey 0dd9634
cheatsheet
pokey 8bbd4b7
tweak
pokey 5c01a2c
typo
pokey 080050f
tweak typing; docstring
pokey 789aa4f
Use implicit destination
AndreasArvidsson 706572b
Renamed wrap actions
AndreasArvidsson 6bb5ec7
Renamed list for insertion mode before and after
AndreasArvidsson acfd38c
Update cursorless-talon/src/targets/range_target.py
AndreasArvidsson 1924ae2
Added range target type literal
AndreasArvidsson dd965ac
[pre-commit.ci lite] apply automatic fixes
pre-commit-ci-lite[bot] 82814ee
Document disable legacy destination tag
AndreasArvidsson c645b33
improve error message
AndreasArvidsson a1450be
Merge branch 'main' into destination-talon
AndreasArvidsson 94a2bcb
Update cheatsheet defaults
pokey File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
from dataclasses import dataclass | ||
|
||
from talon import Module, actions | ||
|
||
from ..targets.target_types import ( | ||
CursorlessDestination, | ||
CursorlessTarget, | ||
ImplicitDestination, | ||
) | ||
|
||
|
||
@dataclass | ||
class BringMoveTargets: | ||
pokey marked this conversation as resolved.
Show resolved
Hide resolved
|
||
source: CursorlessTarget | ||
destination: CursorlessDestination | ||
|
||
|
||
mod = Module() | ||
|
||
|
||
mod.list("cursorless_bring_move_action", desc="Cursorless bring or move actions") | ||
|
||
|
||
@mod.capture(rule="<user.cursorless_target> [<user.cursorless_destination>]") | ||
def cursorless_bring_move_targets(m) -> BringMoveTargets: | ||
source = m.cursorless_target | ||
|
||
try: | ||
destination = m.cursorless_destination | ||
except AttributeError: | ||
destination = ImplicitDestination() | ||
|
||
return BringMoveTargets(source, destination) | ||
|
||
|
||
@mod.action_class | ||
class Actions: | ||
def private_cursorless_bring_move(action_name: str, targets: BringMoveTargets): | ||
"""Execute Cursorless move/bring action""" | ||
actions.user.private_cursorless_command_and_wait( | ||
{ | ||
"name": action_name, | ||
"source": targets.source, | ||
"destination": targets.destination, | ||
} | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,13 @@ | ||
from talon import Module, actions | ||
from talon import actions | ||
|
||
from ..primitive_target import create_implicit_target | ||
from ..targets.target_types import CursorlessTarget, ImplicitTarget | ||
|
||
mod = Module() | ||
|
||
|
||
def run_call_action(target: dict): | ||
targets = [target, create_implicit_target()] | ||
actions.user.cursorless_multiple_target_command("callAsFunction", targets) | ||
def cursorless_call_action(target: CursorlessTarget): | ||
actions.user.private_cursorless_command_and_wait( | ||
{ | ||
"name": "callAsFunction", | ||
"callee": target, | ||
"argument": ImplicitTarget(), | ||
} | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,17 @@ | ||
from talon import actions | ||
|
||
from ..targets.target_types import CursorlessTarget | ||
|
||
|
||
def cursorless_execute_command_action( | ||
command_id: str, target: CursorlessTarget, command_options: dict = {} | ||
): | ||
"""Execute Cursorless execute command action""" | ||
actions.user.private_cursorless_command_and_wait( | ||
{ | ||
"name": "executeCommand", | ||
"commandId": command_id, | ||
"options": command_options, | ||
"target": target, | ||
} | ||
) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,9 +1,11 @@ | ||
from talon import Module | ||
|
||
from ..targets.target_types import CursorlessTarget | ||
|
||
mod = Module() | ||
|
||
|
||
@mod.action_class | ||
class Actions: | ||
def cursorless_private_run_find_action(target: dict): | ||
"""Find text of target in editor""" | ||
def private_cursorless_find(target: CursorlessTarget): | ||
"""Execute Cursorless find action. Find text of target in editor""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.