Skip to content

Commit b62d901

Browse files
Remove deprecated destination grammar (#2753)
Fixes #1715 ## Checklist - [/] 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) - [x] I have not broken the cheatsheet
1 parent 4d01b2c commit b62d901

File tree

2 files changed

+2
-33
lines changed

2 files changed

+2
-33
lines changed

cursorless-talon/src/targets/destination.py

Lines changed: 2 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
from typing import Union
22

3-
from talon import Context, Module, actions
3+
from talon import Module
44

55
from .target_types import ListDestination, PrimitiveDestination
66

@@ -11,39 +11,12 @@
1111
desc="Cursorless insertion mode before/after",
1212
)
1313
mod.list("cursorless_insertion_mode_to", desc="Cursorless insertion mode to")
14-
mod.tag(
15-
"cursorless_disable_legacy_destination",
16-
desc="Disabled the Cursorless legacy destination(to after) support",
17-
)
18-
19-
ctx = Context()
20-
ctx.matches = r"""
21-
tag: user.cursorless_disable_legacy_destination
22-
"""
2314

2415

25-
# DEPRECATED @ 2023-08-01
2616
@mod.capture(
27-
rule="([{user.cursorless_insertion_mode_to}] {user.cursorless_insertion_mode_before_after}) | {user.cursorless_insertion_mode_to}"
28-
)
29-
def cursorless_insertion_mode(m) -> str:
30-
try:
31-
before_after = m.cursorless_insertion_mode_before_after
32-
if hasattr(m, "cursorless_insertion_mode_to"):
33-
words = m._unmapped
34-
actions.app.notify(
35-
f"'{' '.join(words)}' is deprecated. Please just say '{words[-1]}'"
36-
)
37-
return before_after
38-
except AttributeError:
39-
return "to"
40-
41-
42-
@ctx.capture(
43-
"user.cursorless_insertion_mode",
4417
rule="{user.cursorless_insertion_mode_before_after} | {user.cursorless_insertion_mode_to}",
4518
)
46-
def cursorless_insertion_mode_ctx(m) -> str:
19+
def cursorless_insertion_mode(m) -> str:
4720
try:
4821
return m.cursorless_insertion_mode_before_after
4922
except AttributeError:

packages/cursorless-org-docs/src/docs/user/customization.md

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -204,7 +204,3 @@ _You can disable the default Cursorless reformat command by prefixing the spoken
204204
<user.formatters> form <user.cursorless_target>:
205205
user.cursorless_reformat(cursorless_target, formatters)
206206
```
207-
208-
### Disable legacy destination grammar
209-
210-
The grammar currently supports `paste to before air`. This grammar is considered deprecated/legacy and replaced by `paste before air`. You can today disable this legacy grammar by enabling the tag `user.cursorless_disable_legacy_destination`

0 commit comments

Comments
 (0)