Skip to content

Commit 401ad28

Browse files
committed
rewrite
1 parent 1973da6 commit 401ad28

File tree

2 files changed

+6
-8
lines changed

2 files changed

+6
-8
lines changed

cursorless-talon/src/snippets/snippets.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -11,17 +11,14 @@
1111
CustomInsertionSnippet,
1212
CustomWrapperSnippet,
1313
InsertSnippetAction,
14-
ListInsertionSnippet,
15-
ListWrapperSnippet,
1614
ScopeType,
1715
WrapperSnippetAction,
1816
to_scope_types,
1917
)
2018
from .snippets_get import (
21-
get_insertion_snippet,
22-
get_wrapper_snippet,
2319
get_list_insertion_snippet,
2420
get_list_wrapper_snippet,
21+
get_wrapper_snippet,
2522
)
2623

2724
mod = Module()
@@ -34,7 +31,6 @@
3431
mod.list("cursorless_insert_snippet_action", desc="Cursorless insert snippet action")
3532

3633

37-
3834
@mod.action_class
3935
class Actions:
4036
def cursorless_insert_snippet(
@@ -94,6 +90,7 @@ def private_cursorless_wrap_with_community_snippet(
9490
)
9591
actions.user.private_cursorless_command_and_wait(action)
9692

93+
9794
@ctx.action_class("user")
9895
class UserActions:
9996
# Since we don't have a forced language mode, these actions send all the snippets.
@@ -111,7 +108,6 @@ def insert_snippet_by_name(
111108
)
112109
actions.user.private_cursorless_command_and_wait(action)
113110

114-
115111
def private_cursorless_insert_community_snippet(
116112
name: str, # pyright: ignore [reportGeneralTypeIssues]
117113
destination: CursorlessDestination,

cursorless-talon/src/snippets/snippets_get.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -9,14 +9,14 @@
99

1010

1111
def get_insertion_snippet(
12-
name: str,
13-
substitutions: dict[str, str] | None = None
12+
name: str, substitutions: dict[str, str] | None = None
1413
) -> CustomInsertionSnippet:
1514
return CustomInsertionSnippet.create(
1615
actions.user.get_insertion_snippet(name),
1716
substitutions,
1817
)
1918

19+
2020
def get_list_insertion_snippet(
2121
name: str,
2222
substitutions: dict[str, str] | None = None,
@@ -34,9 +34,11 @@ def get_list_insertion_snippet(
3434
[CustomInsertionSnippet.create(s) for s in snippets],
3535
)
3636

37+
3738
def get_wrapper_snippet(name: str) -> CustomWrapperSnippet:
3839
return CustomWrapperSnippet.create(actions.user.get_wrapper_snippet(name))
3940

41+
4042
def get_list_wrapper_snippet(name: str) -> ListWrapperSnippet | CustomWrapperSnippet:
4143
try:
4244
snippets = actions.user.get_wrapper_snippets(name)

0 commit comments

Comments
 (0)