Skip to content

Commit a07c9c7

Browse files
committed
Cursorless 0.5.0; other stuff
1 parent abf9b66 commit a07c9c7

File tree

4 files changed

+22
-9
lines changed

4 files changed

+22
-9
lines changed

apps/vscode/cursorless/cursorless.talon

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@ pour <user.cursorless_arg>:
1111
user.cursorless_single_target_command("setSelection", cursorless_arg)
1212
user.new_line_below()
1313

14-
funk wrap <user.cursorless_arg> with <user.code_functions>:
14+
funk <user.code_functions> wrap <user.cursorless_arg>:
1515
user.cursorless_single_target_command("wrap", cursorless_arg, "{code_functions}(", ")")
1616

1717
square wrap <user.cursorless_arg>:
@@ -32,4 +32,7 @@ quad wrap <user.cursorless_arg>:
3232
twin wrap <user.cursorless_arg>:
3333
user.cursorless_single_target_command("wrap", cursorless_arg, "'", "'")
3434

35+
puff <user.cursorless_arg>:
36+
user.cursorless_single_target_command("wrap", cursorless_arg, "\n", "\n")
37+
3538
action(user.dental_click): user.vscode("cursorless.toggleDecorations")

apps/vscode/cursorless/target.py

Lines changed: 13 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -86,13 +86,17 @@ def make_simple_transformation(type: str):
8686
"arg": "argumentOrParameter",
8787
"arrow": "arrowFunction",
8888
"class": "class",
89+
"elm": "listElement",
8990
"funk": "namedFunction",
9091
"if": "ifStatement",
92+
"invoke": "functionCall",
93+
"key": "pairKey",
9194
"lambda": "arrowFunction",
95+
"list": "list",
9296
"map": "dictionary",
9397
"pair": "pair",
94-
"value": "pairValue",
95-
"key": "pairKey",
98+
"state": "statement",
99+
"value": "value",
96100
}
97101

98102
containing_scope_types = {
@@ -140,6 +144,7 @@ def json_repr(self):
140144
}
141145

142146
cursor_mark = {"mark": {"type": "cursor"}}
147+
that_mark = {"mark": {"type": "that"}}
143148

144149
marks = {
145150
"here": cursor_mark,
@@ -152,12 +157,17 @@ def json_repr(self):
152157
f"these {selection_type.plural}": {**selection_type.json_repr, **cursor_mark}
153158
for selection_type in SELECTION_TYPES
154159
},
155-
"change": {"mark": {"type": "lastEditRange"}},
160+
"there": that_mark,
161+
"that": that_mark,
156162
"last cursor": {"mark": {"type": "lastCursorPosition"}},
157163
**{
158164
f"this {containing_scope_type}": {**cursor_mark, **value}
159165
for containing_scope_type, value in containing_scope_types.items()
160166
},
167+
**{
168+
f"that {containing_scope_type}": {**that_mark, **value}
169+
for containing_scope_type, value in containing_scope_types.items()
170+
},
161171
}
162172

163173
mod.list("cursorless_mark", desc="Types of marks")

lang/typescript/typescript.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,9 +8,10 @@
88
"""
99
# tbd
1010
ctx.lists["user.code_functions"] = {
11-
# "integer": "int.TryParse",
11+
# "integer": "int.TryParse",
1212
"print": "console.log",
13-
# "string": ".ToString",
13+
"flatten": "flatten",
14+
# "string": ".ToString",
1415
}
1516

1617

@@ -80,4 +81,3 @@ def code_public_function(text: str):
8081
# )
8182

8283
# actions.user.code_insert_function(result, None)
83-

lang/typescript/typescript.talon

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,9 +14,9 @@ settings():
1414
user.code_protected_variable_formatter = "PRIVATE_CAMEL_CASE"
1515
user.code_public_variable_formatter = "PRIVATE_CAMEL_CASE"
1616

17-
action(user.code_is_not_null): " !== null"
17+
action(user.code_is_not_null): " != null"
1818

19-
action(user.code_is_null): " === null"
19+
action(user.code_is_null): " == null"
2020

2121
action(user.code_type_dictionary):
2222
insert("{}")

0 commit comments

Comments
 (0)