Skip to content

Commit

Permalink
configurable number prefix without mouse grid (talonhub#1342)
Browse files Browse the repository at this point in the history
- Attempt to implement optional numb prefix
- The tags need to be logically combined
- Respond to suggestion that the mouse grid should not be considered

---------

Co-authored-by: fidgetingbits <fidgetingbits@memeoid.cx>
Co-authored-by: FidgetingBits <fidgetingbits@users.noreply.github.com>
Co-authored-by: Pokey Rule <755842+pokey@users.noreply.github.com>
  • Loading branch information
4 people authored Feb 22, 2024
1 parent 520b106 commit 54ce69d
Show file tree
Hide file tree
Showing 6 changed files with 20 additions and 4 deletions.
6 changes: 5 additions & 1 deletion BREAKING_CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,11 @@ applied given the delay between changes being submitted and the time they were r
and merged.

---
* 2023-06-06 Deprecate `go marks` command for VSCode. Use 'bar marks' instead.
* 2024-01-27 Deprecate '<user.number_string>' command without a spoken prefix like `numb`.
See `numbers.talon` and `numbers_unprefixed.talon.` If in the future you want to still use
unprefixed numbers, you will need to comment out the
`tag(): user.prefixed_numbers` line in your `settings.talon` file.
* 2023-06-06 Deprecate `go ` command for VSCode. Use 'bar marks' instead.
* 2023-02-04 Deprecate `murder` command for i3wm. Use 'win kill' instead.
* 2022-12-11 Deprecate user.insert_with_history. Just use `user.add_phrase_to_history(text);
insert(text)` instead. See #939.
Expand Down
2 changes: 2 additions & 0 deletions core/mouse_grid/mouse_grid_open.talon
Original file line number Diff line number Diff line change
@@ -1,5 +1,7 @@
tag: user.mouse_grid_showing
-
# Force prefixed numbers elsewhere in the config, which allows unprefixed use below
tag(): user.prefixed_numbers
<user.number_key>: user.grid_narrow(number_key)
grid off: user.grid_close()

Expand Down
1 change: 1 addition & 0 deletions core/numbers/numbers.py
Original file line number Diff line number Diff line change
Expand Up @@ -177,6 +177,7 @@ def split_list(value, l: list) -> Iterator:
number_small_map = {n: i for i, n in enumerate(number_small_list)}

mod.list("number_small", desc="List of small numbers")
mod.tag("prefixed_numbers", desc="Require prefix when saying a number")
ctx.lists["self.number_small"] = number_small_map.keys()


Expand Down
4 changes: 1 addition & 3 deletions core/numbers/numbers.talon
Original file line number Diff line number Diff line change
@@ -1,3 +1 @@
not tag: user.mouse_grid_showing
-
<user.number_string>: "{number_string}"
numb <user.number_string>: "{number_string}"
5 changes: 5 additions & 0 deletions core/numbers/numbers_unprefixed.talon
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
not tag: user.prefixed_numbers
-
<user.number_string>:
insert("{number_string}")
user.deprecate_command("2024-01-27", "<number>", "numb <number>")
6 changes: 6 additions & 0 deletions settings.talon
Original file line number Diff line number Diff line change
Expand Up @@ -70,3 +70,9 @@ settings():
# Uncomment to enable the curse yes/curse no commands (show/hide mouse cursor).
# See issue #688 for more detail: https://github.com/talonhub/community/issues/688
# tag(): user.mouse_cursor_commands_enable

# Uncomment the below to disable support for saying numbers without a prefix.
# By default saying "one" would write "1", however many users find this behavior
# prone to false positives. If you uncomment this, you will need to say
# "numb one" to write "1". Note that this tag will eventually be activated by default
# tag(): user.prefixed_numbers

0 comments on commit 54ce69d

Please sign in to comment.