~callum/barszcz

1a779ac843d7d10c590484a65980f6b35eca6812 — Callum Brown 1 year, 10 months ago 6ab72e8
Only disregard existing shortcut to clear input

Disregarding existing shortcut input if the just pressed key is a
shortcut itself means you can't have shortcuts that include that
character - not very good.
However, disregarding existing input when the key just pressed is
used to clear shortcut input (by default the escape key), is necessary.
1 files changed, 5 insertions(+), 4 deletions(-)

M beetsplug/barszcz.py
M beetsplug/barszcz.py => beetsplug/barszcz.py +5 -4
@@ 602,10 602,11 @@ class Barszcz:
                    # of times a shortcut input in future should be repeated.
                    # NOTE: This means shortcuts can not start with a digit.
                    shortcut_reps += key
                elif key in shortcuts:
                    # If the key just pressed is a shortcut on its own,
                    # just do that rather than add it to the existing sequence.
                    command = shortcuts[key]
                elif shortcuts.get(key) == "":
                    # If the key just pressed is a shortcut for clearing the
                    # shortcut input then do that rather than add it to the
                    # existing sequence.
                    command = ""
                else:
                    # Add to sequence of characters currently being input
                    shortcut += key