From 63e7c4c63a2e825df2665c482e34b632ca7fb8b0 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 24 Jan 2025 16:35:25 +0100 Subject: [PATCH 1/2] Remove deprecated destination grammar --- cursorless-talon/src/targets/destination.py | 31 ++------------------- 1 file changed, 2 insertions(+), 29 deletions(-) diff --git a/cursorless-talon/src/targets/destination.py b/cursorless-talon/src/targets/destination.py index 85ef3a517c..0c01864942 100644 --- a/cursorless-talon/src/targets/destination.py +++ b/cursorless-talon/src/targets/destination.py @@ -1,6 +1,6 @@ from typing import Union -from talon import Context, Module, actions +from talon import Module from .target_types import ListDestination, PrimitiveDestination @@ -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: From ce3c299be29104e5595553d07bfc11b441f6b9b8 Mon Sep 17 00:00:00 2001 From: Andreas Arvidsson Date: Fri, 24 Jan 2025 16:36:55 +0100 Subject: [PATCH 2/2] Update docs --- packages/cursorless-org-docs/src/docs/user/customization.md | 4 ---- 1 file changed, 4 deletions(-) diff --git a/packages/cursorless-org-docs/src/docs/user/customization.md b/packages/cursorless-org-docs/src/docs/user/customization.md index 1ffa782f1a..871c9cb734 100644 --- a/packages/cursorless-org-docs/src/docs/user/customization.md +++ b/packages/cursorless-org-docs/src/docs/user/customization.md @@ -204,7 +204,3 @@ _You can disable the default Cursorless reformat command by prefixing the spoken form : 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`