diff --git a/src/command.py b/src/command.py index 54fa3c93..168d976c 100644 --- a/src/command.py +++ b/src/command.py @@ -1,8 +1,17 @@ -from talon import actions, Module +from talon import actions, Module, speech_system from typing import Any, List mod = Module() +last_phrase = None + + +def on_phrase(d): + global last_phrase + last_phrase = d + +speech_system.register("pre:phrase", on_phrase) + class NotSet: def __repr__(self): @@ -68,8 +77,10 @@ def cursorless_multiple_target_command( ): """Execute multi-target cursorless command""" args = list(filter(lambda x: x is not NotSet, [arg1, arg2, arg3])) + spoken_form = " ".join(last_phrase["phrase"]) actions.user.vscode_with_plugin_and_wait( "cursorless.command", + spoken_form, action, targets, *args,