Skip to content

Commit 4d20d6f

Browse files
AndreasArvidssonpokeypre-commit-ci[bot]
authored
Allow using "this" to refer to current token with empty selection (#1094)
- Fixes #1043 - Fixes #1141 - Depends on #1187 ## Checklist - [x] I have added [tests](https://www.cursorless.org/docs/contributing/test-case-recorder/) - [x] I have updated the [docs](https://github.com/cursorless-dev/cursorless/tree/main/docs) and [cheatsheet](https://github.com/cursorless-dev/cursorless/tree/main/cursorless-talon/src/cheatsheet) Co-authored-by: Pokey Rule <[email protected]> Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
1 parent e082a97 commit 4d20d6f

File tree

3 files changed

+5
-4
lines changed

3 files changed

+5
-4
lines changed

src/command.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,7 @@
1212
mod = Module()
1313

1414
CURSORLESS_COMMAND_ID = "cursorless.command"
15+
CURSORLESS_COMMAND_VERSION = 4
1516
last_phrase = None
1617

1718

@@ -136,7 +137,7 @@ def construct_cursorless_command_argument(
136137
use_pre_phrase_snapshot = False
137138

138139
return {
139-
"version": 3,
140+
"version": CURSORLESS_COMMAND_VERSION,
140141
"spokenForm": get_spoken_form(),
141142
"action": {
142143
"name": action,

src/compound_targets.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@
33
from talon import Module
44

55
from .connective import default_range_connective
6-
from .primitive_target import BASE_TARGET
6+
from .primitive_target import IMPLICIT_TARGET
77

88
mod = Module()
99

@@ -46,7 +46,7 @@ def cursorless_range(m) -> dict[str, Any]:
4646
return primitive_targets[0]
4747

4848
if len(primitive_targets) == 1:
49-
anchor = BASE_TARGET.copy()
49+
anchor = IMPLICIT_TARGET.copy()
5050
else:
5151
anchor = primitive_targets[0]
5252

src/primitive_target.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
mod = Module()
77

88
BASE_TARGET: dict[str, Any] = {"type": "primitive"}
9-
IMPLICIT_TARGET = {"type": "primitive", "isImplicit": True}
9+
IMPLICIT_TARGET = {"type": "implicit"}
1010

1111

1212
@mod.capture(

0 commit comments

Comments
 (0)