From 056c0c3c14c2f0aad7603bcdb069e067ab7268dd Mon Sep 17 00:00:00 2001 From: nanjekyejoannah Date: Tue, 16 Aug 2016 14:45:20 +0300 Subject: [PATCH 1/3] Make command keys configurable Fixes #672 --- qutebrowser/config/configdata.py | 3 +++ qutebrowser/keyinput/modeparsers.py | 5 +---- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 739799b28..608ae2b27 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -1477,6 +1477,9 @@ KEY_DATA = collections.OrderedDict([ ('set-cmd-text :open -b -i {url:pretty}', ['xO']), ('set-cmd-text -s :open -w', ['wo']), ('set-cmd-text :open -w {url:pretty}', ['wO']), + ('set-cmd-text -s :search', ['/']), + ('set-cmd-text -s :search -r', ['?']), + ('set-cmd-text -s : ', [':']), ('open -t', ['ga', '']), ('open -w', ['']), ('tab-close', ['d', '']), diff --git a/qutebrowser/keyinput/modeparsers.py b/qutebrowser/keyinput/modeparsers.py index fb923bf92..455330f93 100644 --- a/qutebrowser/keyinput/modeparsers.py +++ b/qutebrowser/keyinput/modeparsers.py @@ -70,9 +70,6 @@ class NormalKeyParser(keyparser.CommandKeyParser): self._debug_log("Ignoring key '{}', because the normal mode is " "currently inhibited.".format(txt)) return self.Match.none - if not self._keystring and any(txt == c for c in STARTCHARS): - message.set_cmd_text(self._win_id, txt) - return self.Match.definitive match = super()._handle_single_key(e) if match == self.Match.partial: timeout = config.get('input', 'partial-timeout') @@ -231,7 +228,7 @@ class HintKeyParser(keyparser.CommandKeyParser): if keytype == self.Type.chain: hintmanager = objreg.get('hintmanager', scope='tab', window=self._win_id, tab='current') - hintmanager.handle_partial_key(cmdstr) + hintmanager.fire(cmdstr) else: # execute as command super().execute(cmdstr, keytype, count) From 29cd878902b3b82d50542f9c185bf244bd8dbfaa Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 19 Aug 2016 13:39:12 +0200 Subject: [PATCH 2/3] Fix lint --- qutebrowser/config/configdata.py | 2 +- qutebrowser/keyinput/modeparsers.py | 1 - 2 files changed, 1 insertion(+), 2 deletions(-) diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 608ae2b27..699feb9a3 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -1479,7 +1479,7 @@ KEY_DATA = collections.OrderedDict([ ('set-cmd-text :open -w {url:pretty}', ['wO']), ('set-cmd-text -s :search', ['/']), ('set-cmd-text -s :search -r', ['?']), - ('set-cmd-text -s : ', [':']), + ('set-cmd-text -s :', [':']), ('open -t', ['ga', '']), ('open -w', ['']), ('tab-close', ['d', '']), diff --git a/qutebrowser/keyinput/modeparsers.py b/qutebrowser/keyinput/modeparsers.py index 455330f93..c5dd341fe 100644 --- a/qutebrowser/keyinput/modeparsers.py +++ b/qutebrowser/keyinput/modeparsers.py @@ -25,7 +25,6 @@ Module attributes: from PyQt5.QtCore import pyqtSlot, Qt -from qutebrowser.utils import message from qutebrowser.config import config from qutebrowser.keyinput import keyparser from qutebrowser.utils import usertypes, log, objreg, utils From 5a3328d834cede37da1d7a063fbad74f99420088 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Fri, 19 Aug 2016 13:41:21 +0200 Subject: [PATCH 3/3] Update docs --- CHANGELOG.asciidoc | 2 ++ README.asciidoc | 2 +- 2 files changed, 3 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 045402ea2..a11969268 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -97,6 +97,8 @@ Changed - Sending a command to an existing instance (via "qutebrowser :reload") now doesn't mark it as urgent anymore. - `tabs -> title-format` now treats an empty string as valid. +- Bindings for `:`, `/` and `?` are now configured explicitly and not hardcoded + anymore. Deprecated ~~~~~~~~~~ diff --git a/README.asciidoc b/README.asciidoc index 147e9fa03..ebcc58316 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -172,9 +172,9 @@ Contributors, sorted by the number of commits in descending order: * ZDarian * Milan Svoboda * John ShaggyTwoDope Jenkins +* nanjekyejoannah * Peter Vilim * Clayton Craft -* nanjekyejoannah * Oliver Caldwell * Jonas Schürmann * error800