From 1b0aea5e0578bb439a8b564c7e4a944a7fb0c468 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 27 Feb 2018 06:56:57 +0100 Subject: [PATCH] Bring simple bindings to front in get_reverse_bindings_for --- qutebrowser/config/config.py | 13 ++++++------- 1 file changed, 6 insertions(+), 7 deletions(-) diff --git a/qutebrowser/config/config.py b/qutebrowser/config/config.py index 14022d1d2..0a106ea05 100644 --- a/qutebrowser/config/config.py +++ b/qutebrowser/config/config.py @@ -157,16 +157,15 @@ class KeyConfig: """Get a dict of commands to a list of bindings for the mode.""" cmd_to_keys = {} bindings = self.get_bindings_for(mode) - for key, full_cmd in sorted(bindings.items()): + for seq, full_cmd in sorted(bindings.items()): for cmd in full_cmd.split(';;'): cmd = cmd.strip() cmd_to_keys.setdefault(cmd, []) - # put special bindings last - # FIXME update - # if utils.is_special_key(key): - # cmd_to_keys[cmd].append(key) - # else: - cmd_to_keys[cmd].insert(0, str(key)) + # Put bindings involving modifiers last + if any(info.modifiers for info in seq): + cmd_to_keys[cmd].append(str(seq)) + else: + cmd_to_keys[cmd].insert(0, str(seq)) return cmd_to_keys def get_command(self, key, mode, default=False):