From 737ff2cc690b9c848ab54b33eec128917be8709b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 29 Dec 2017 14:43:04 +0100 Subject: [PATCH] Add <> around special keys in __str__ --- qutebrowser/keyinput/keyutils.py | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/qutebrowser/keyinput/keyutils.py b/qutebrowser/keyinput/keyutils.py index 77a45a7fe..31c9507b3 100644 --- a/qutebrowser/keyinput/keyutils.py +++ b/qutebrowser/keyinput/keyutils.py @@ -183,7 +183,13 @@ def key_with_modifiers_to_string(key, modifiers): parts = [] parts.append(key_string) - return normalize_keystr('+'.join(parts)) + normalized = normalize_keystr('+'.join(parts)) + if len(normalized) > 1: + # "special" binding + return '<{}>'.format(normalized) + else: + # "normal" binding + return normalized class KeyParseError(Exception):