From 39508d984e97b7315e506acdc38bba7d7b5bf3fd Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 6 Feb 2017 15:48:05 +0100 Subject: [PATCH] Handle multiple commands in KeyConfigParser.get_reverse_bindings_for --- qutebrowser/config/parsers/keyconf.py | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/qutebrowser/config/parsers/keyconf.py b/qutebrowser/config/parsers/keyconf.py index 3a658c4b1..6ca5f72b7 100644 --- a/qutebrowser/config/parsers/keyconf.py +++ b/qutebrowser/config/parsers/keyconf.py @@ -435,11 +435,13 @@ class KeyConfigParser(QObject): def get_reverse_bindings_for(self, section): """Get a dict of commands to a list of bindings for the section.""" cmd_to_keys = {} - for key, cmd in self.get_bindings_for(section).items(): - cmd_to_keys.setdefault(cmd, []) - # put special bindings last - if utils.is_special_key(key): - cmd_to_keys[cmd].append(key) - else: - cmd_to_keys[cmd].insert(0, key) + for key, full_cmd in self.get_bindings_for(section).items(): + for cmd in full_cmd.split(';;'): + cmd = cmd.strip() + cmd_to_keys.setdefault(cmd, []) + # put special bindings last + if utils.is_special_key(key): + cmd_to_keys[cmd].append(key) + else: + cmd_to_keys[cmd].insert(0, key) return cmd_to_keys