From a2f62238f1134e0befcd03d84c131ec0dbc30151 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sun, 2 Jul 2017 12:39:45 +0200 Subject: [PATCH] Change default binding to leave passthrough mode to Ctrl-V Also, display the binding in the statusbar --- qutebrowser/config/configdata.yml | 2 +- qutebrowser/mainwindow/statusbar/bar.py | 12 +++++++++++- 2 files changed, 12 insertions(+), 2 deletions(-) diff --git a/qutebrowser/config/configdata.yml b/qutebrowser/config/configdata.yml index 67ed5dd75..c4062ac62 100644 --- a/qutebrowser/config/configdata.yml +++ b/qutebrowser/config/configdata.yml @@ -1979,7 +1979,7 @@ bindings.default: : hint all tab-bg : leave-mode passthrough: - : leave-mode + : leave-mode command: # FIXME:conf what to do about up/down? : command-history-prev diff --git a/qutebrowser/mainwindow/statusbar/bar.py b/qutebrowser/mainwindow/statusbar/bar.py index 2a0c38a75..555aee57c 100644 --- a/qutebrowser/mainwindow/statusbar/bar.py +++ b/qutebrowser/mainwindow/statusbar/bar.py @@ -263,7 +263,17 @@ class StatusBar(QWidget): def _set_mode_text(self, mode): """Set the mode text.""" - text = "-- {} MODE --".format(mode.upper()) + if mode == 'passthrough': + key_instance = config.key_instance + all_bindings = key_instance.get_reverse_bindings_for('passthrough') + bindings = all_bindings.get('leave-mode') + if bindings: + suffix = ' ({} to leave)'.format(bindings[0]) + else: + suffix = '' + else: + suffix = '' + text = "-- {} MODE --{}".format(mode.upper(), suffix) self.txt.set_text(self.txt.Text.normal, text) def _show_cmd_widget(self):