From b32edf54f8a704946cccf332251236dbaa2df34b Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 15 Jan 2022 15:17:30 +0530 Subject: [PATCH] hints kitten: Document how to choose the empty hint for multi key hints --- docs/kittens/hints.rst | 6 ++++++ kittens/hints/main.py | 2 +- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/docs/kittens/hints.rst b/docs/kittens/hints.rst index 61d436893..a6eb2be64 100644 --- a/docs/kittens/hints.rst +++ b/docs/kittens/hints.rst @@ -33,6 +33,12 @@ that has been marked as such by the program running in the terminal, for example, by ``ls --hyperlink=auto``. You can also :doc:`customize what actions are taken for different types of URLs <../open_actions>`. +.. note:: If there are more hints than letters, hints will use multiple + letters. In this case, when you press the first letter, only hints + starting with that letter are displayed. Pressing the second letter will + select that hint or press :kbd:`Enter` or :kbd:`Space` to select the empty + hint. + The hints kitten is very powerful to see more detailed help on its various options and modes of operation, see below. You can use these options to create mappings in :file:`kitty.conf` to select various different text diff --git a/kittens/hints/main.py b/kittens/hints/main.py index 8e35939ab..df2e7fe01 100644 --- a/kittens/hints/main.py +++ b/kittens/hints/main.py @@ -186,7 +186,7 @@ class Hints(Handler): self.current_input = self.current_input[:-1] self.current_text = None self.draw_screen() - elif key_event.matches('enter') and self.current_input: + elif (key_event.matches('enter') or key_event.matches('space')) and self.current_input: try: idx = decode_hint(self.current_input, self.alphabet) self.chosen.append(self.index_map[idx])