From c050b4973b47786538a8514d00a394bc25655bc8 Mon Sep 17 00:00:00 2001 From: Ryan Roden-Corrent Date: Wed, 18 May 2016 07:54:06 -0400 Subject: [PATCH] Show special keys last in command completion. When showing the currently bound key in the misc column for command completion, if the command has multiple bindings, show special bindings (e.g. ) after non-special bindings. --- qutebrowser/completion/models/miscmodels.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/qutebrowser/completion/models/miscmodels.py b/qutebrowser/completion/models/miscmodels.py index 08cba8c58..99904d1f4 100644 --- a/qutebrowser/completion/models/miscmodels.py +++ b/qutebrowser/completion/models/miscmodels.py @@ -56,7 +56,11 @@ class CommandCompletionModel(base.BaseCompletionModel): keyconf = objreg.get('key-config') cmd_to_keys = defaultdict(list) for key, cmd in keyconf.get_bindings_for('normal').items(): - cmd_to_keys[cmd].append(key) + # put special bindings last + if key.startswith('<') and key.endswith('>'): + cmd_to_keys[cmd].append(key) + else: + cmd_to_keys[cmd].insert(0, key) for (name, desc) in sorted(cmdlist): self.new_item(cat, name, desc, str.join(', ', cmd_to_keys[name]))