Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
31 changes: 2 additions & 29 deletions cursorless-talon/src/targets/destination.py
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
from typing import Union

from talon import Context, Module, actions
from talon import Module

from .target_types import ListDestination, PrimitiveDestination

Expand All @@ -11,39 +11,12 @@
desc="Cursorless insertion mode before/after",
)
mod.list("cursorless_insertion_mode_to", desc="Cursorless insertion mode to")
mod.tag(
"cursorless_disable_legacy_destination",
desc="Disabled the Cursorless legacy destination(to after) support",
)

ctx = Context()
ctx.matches = r"""
tag: user.cursorless_disable_legacy_destination
"""


# DEPRECATED @ 2023-08-01
@mod.capture(
rule="([{user.cursorless_insertion_mode_to}] {user.cursorless_insertion_mode_before_after}) | {user.cursorless_insertion_mode_to}"
)
def cursorless_insertion_mode(m) -> str:
try:
before_after = m.cursorless_insertion_mode_before_after
if hasattr(m, "cursorless_insertion_mode_to"):
words = m._unmapped
actions.app.notify(
f"'{' '.join(words)}' is deprecated. Please just say '{words[-1]}'"
)
return before_after
except AttributeError:
return "to"


@ctx.capture(
"user.cursorless_insertion_mode",
rule="{user.cursorless_insertion_mode_before_after} | {user.cursorless_insertion_mode_to}",
)
def cursorless_insertion_mode_ctx(m) -> str:
def cursorless_insertion_mode(m) -> str:
try:
return m.cursorless_insertion_mode_before_after
except AttributeError:
Expand Down
4 changes: 0 additions & 4 deletions packages/cursorless-org-docs/src/docs/user/customization.md
Original file line number Diff line number Diff line change
Expand Up @@ -204,7 +204,3 @@ _You can disable the default Cursorless reformat command by prefixing the spoken
<user.formatters> form <user.cursorless_target>:
user.cursorless_reformat(cursorless_target, formatters)
```

### Disable legacy destination grammar

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`
Loading