Skip to content

Commit

Permalink
address review feedback
Browse files Browse the repository at this point in the history
  • Loading branch information
knausj85 committed Aug 5, 2023
1 parent 6b3073a commit b551c2c
Show file tree
Hide file tree
Showing 6 changed files with 30 additions and 23 deletions.
Original file line number Diff line number Diff line change
@@ -1,14 +1,16 @@
# this functionality is only available in the talon beta
from talon import Module

mod = Module()
mod.apps.talon_debug = """
mod.apps.talon_debug_window = """
os: mac
and app.bundle: com.talonvoice.Talon
win.title: Talon Debug
"""
mod.apps.talon_debug = """
mod.apps.talon_debug_window = """
os: windows
and app.name: Talon
os: windows
and app.exe: talon.exe
win.title: Talon Debug
"""
Original file line number Diff line number Diff line change
@@ -1,16 +1,17 @@
app: talon_debug
# this functionality is only available in the talon beta
app: talon_debug_window
-
tag {user.talon_tags}: user.paste("{talon_tags}")
tag {user.talon_tags}: "{talon_tags}"

#commands for dictating key combos
key <user.keys> over: "{keys}"
key <user.modifiers> over: "{modifiers}"

action {user.talon_actions}: insert(talon_actions)
action {user.talon_actions}: "{talon_actions}"
# requires user.talon_populate_lists tag. do not use with dragon
list {user.talon_lists}: "{talon_lists}"

# requires user.talon_populate_lists tag. do not use with dragon
capture {user.talon_captures}: "{talon_captures}"
set {user.talon_settings}: user.paste("{talon_settings}")
application {user.talon_apps}: user.paste("{talon_apps}")
set {user.talon_settings}: "{talon_settings}"
application {user.talon_apps}: "{talon_apps}"
8 changes: 4 additions & 4 deletions lang/talon/talon-code_common_function.talon-list
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
list: user.code_common_function
tag: user.talon
-
insert: insert
key: key
print: print
repeat: repeat
insert
key
print
repeat
4 changes: 2 additions & 2 deletions lang/talon/talon-common.talon
Original file line number Diff line number Diff line change
Expand Up @@ -5,14 +5,14 @@ tag: user.talon_python

tag set [{user.talon_tags}]:
tag = talon_tags or ""
user.talon_code_assert_tag(tag)
user.talon_code_enable_tag(tag)

# requires user.talon_populate_lists tag. do not use with dragon
list {user.talon_lists}: "{{{talon_lists}}}"
# requires user.talon_populate_lists tag. do not use with dragon
capture {user.talon_captures}: "<{talon_captures}>"

setting {user.talon_settings}: user.talon_code_assert_setting(talon_settings)
setting {user.talon_settings}: user.talon_code_enable_setting(talon_settings)

#commands for dictating key combos
key <user.keys> over: "{keys}"
Expand Down
12 changes: 8 additions & 4 deletions lang/talon/talon-python-activator.talon
Original file line number Diff line number Diff line change
@@ -1,7 +1,11 @@
app: vscode
win.title: /— user/
win.title: /— knausj_talon/
win.title: / - user - Visual Studio Code/
# This file activates talon-specific python commands
# by default, it simply looks for the python tag to be active
# lines 5-8 provide an example to make the activation more specific
# which may be preferred by people who code in other python projects
# app: vscode
# win.title: /— user/
# win.title: /— knausj_talon/
# win.title: / - user - Visual Studio Code/
tag: user.python
-
tag(): user.talon_python
12 changes: 6 additions & 6 deletions lang/talon/talon.py
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,10 @@ class Actions:
def talon_code_insert_function(text: str, selection: str):
"""inserts talon-specific action call"""

def talon_code_assert_tag(tag: str):
def talon_code_enable_tag(tag: str):
"""enables tag in either python or talon files"""

def talon_code_assert_setting(setting: str):
def talon_code_enable_setting(setting: str):
"""asserts setting in either python or talon files"""


Expand All @@ -95,11 +95,11 @@ def talon_code_insert_function(text: str, selection: str):
actions.user.paste(text)
actions.edit.left()

def talon_code_assert_tag(tag: str):
def talon_code_enable_tag(tag: str):
"""enables tag in either python or talon files"""
actions.user.paste(f"tag(): {tag}")

def talon_code_assert_setting(setting: str):
def talon_code_enable_setting(setting: str):
"""asserts setting in either python or talon files"""
actions.user.paste(f"{setting} = ")

Expand All @@ -111,14 +111,14 @@ def talon_code_insert_function(text: str, selection: str):
actions.user.paste(text)
actions.edit.left()

def talon_code_assert_tag(tag: str):
def talon_code_enable_tag(tag: str):
"""enables tag in either python or talon files"""
actions.user.paste(f'ctx.tags = ["{tag}"]')
if not tag:
actions.edit.left()
actions.edit.left()

def talon_code_assert_setting(setting: str):
def talon_code_enable_setting(setting: str):
"""asserts setting in either python or talon files"""
actions.user.paste(f'ctx.settings["{setting}"] = ')
if not setting:
Expand Down

0 comments on commit b551c2c

Please sign in to comment.