From 1819b46fe02c3ace6da3bfd99ce9a14251d43413 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Mon, 8 Aug 2016 18:41:25 +0200 Subject: [PATCH 1/4] suppress hiding hints in rapid mode fixes #1799 --- qutebrowser/browser/hints.py | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 278ad7d0d..be4a621a3 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -764,8 +764,10 @@ class HintManager(QObject): # hidden element which matches again -> show it self._show_elem(elem.label) else: - # element doesn't match anymore -> hide it - self._hide_elem(elem.label) + # element doesn't match anymore -> hide it, unless in rapid + # hinting mode (see #1799) + if not self._context.rapid: + self._hide_elem(elem.label) except webelem.Error: pass From 7271955c56633b7d83c2f787d33975e0b830254c Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 9 Aug 2016 10:34:34 +0200 Subject: [PATCH 2/4] make hiding unmatched rapid hints configurable --- qutebrowser/browser/hints.py | 5 +++-- qutebrowser/config/configdata.py | 4 ++++ 2 files changed, 7 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index be4a621a3..dd68cf383 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -765,8 +765,9 @@ class HintManager(QObject): self._show_elem(elem.label) else: # element doesn't match anymore -> hide it, unless in rapid - # hinting mode (see #1799) - if not self._context.rapid: + # mode and hide-unmatched-rapid-hints is false (see #1799) + if (not self._context.rapid or + config.get('hints', 'hide-unmatched-rapid-hints')): self._hide_elem(elem.label) except webelem.Error: pass diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index df673a50b..bded87801 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -956,6 +956,10 @@ def data(readonly=False): )), 'python'), "Which implementation to use to find elements to hint."), + ('hide-unmatched-rapid-hints', + SettingValue(typ.Bool(), 'true'), + "Controls hiding unmatched hints in rapid mode."), + readonly=readonly )), From 70570f22b036174768fbbc90ce913dd7220aa3ac Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jakub=20Klinkovsk=C3=BD?= Date: Tue, 9 Aug 2016 11:02:21 +0200 Subject: [PATCH 3/4] add manual test for hiding unmatched rapid hints --- .../hints/hide_unmatched_rapid_hints.html | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 tests/manual/hints/hide_unmatched_rapid_hints.html diff --git a/tests/manual/hints/hide_unmatched_rapid_hints.html b/tests/manual/hints/hide_unmatched_rapid_hints.html new file mode 100644 index 000000000..d9535733f --- /dev/null +++ b/tests/manual/hints/hide_unmatched_rapid_hints.html @@ -0,0 +1,25 @@ + + + + + Hide unmatched rapid hints + + +

When hints -> hide-unmatched-rapid-hints is set to true (default), rapid hints behave like normal hints, i.e. unmatched hints will be hidden as you type. Setting the option to false will disable hiding in rapid mode, which is sometimes useful (see #1799).

+

Note that when hinting in number mode, the hints -> hide-unmatched-rapid-hints option affects typing the hint string (number), but not the filter (letters).

+

Here is couple of invalid links to test the behaviour:

+

one

+

two

+

three

+

four

+

five

+

six

+

seven

+

eight

+

nine

+

ten

+

eleven

+

twelve

+

thirteen

+ + From cf519bd52898f1e05695a992327076bfe4850dca Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Tue, 9 Aug 2016 16:44:00 +0200 Subject: [PATCH 4/4] Update docs --- CHANGELOG.asciidoc | 2 ++ README.asciidoc | 2 +- doc/help/settings.asciidoc | 12 ++++++++++++ 3 files changed, 15 insertions(+), 1 deletion(-) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index d8e885303..1cdc19113 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -28,6 +28,8 @@ Added completion category headers. - New `:debug-log-capacity` command to adjust how many lines are logged into RAM (to report bugs which are difficult to reproduce). +- New `hide-unmatched-rapid-hints` option to not hide hint unmatched hint labels + in rapid mode. Changed ~~~~~~~ diff --git a/README.asciidoc b/README.asciidoc index 10ff04de9..9dab267f1 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -147,8 +147,8 @@ Contributors, sorted by the number of commits in descending order: * Bruno Oliveira * Alexander Cogneau * Marshall Lochbaum -* Felix Van der Jeugt * Jakub Klinkovský +* Felix Van der Jeugt * Martin Tournoij * Jan Verbeek * Raphael Pierzina diff --git a/doc/help/settings.asciidoc b/doc/help/settings.asciidoc index 1bc70e45f..7670057fb 100644 --- a/doc/help/settings.asciidoc +++ b/doc/help/settings.asciidoc @@ -190,6 +190,7 @@ |<>|A comma-separated list of regexes to use for 'next' links. |<>|A comma-separated list of regexes to use for 'prev' links. |<>|Which implementation to use to find elements to hint. +|<>|Controls hiding unmatched hints in rapid mode. |============== .Quick reference for section ``colors'' @@ -1698,6 +1699,17 @@ Valid values: Default: +pass:[python]+ +[[hints-hide-unmatched-rapid-hints]] +=== hide-unmatched-rapid-hints +Controls hiding unmatched hints in rapid mode. + +Valid values: + + * +true+ + * +false+ + +Default: +pass:[true]+ + == searchengines Definitions of search engines which can be used via the address bar. The searchengine named `DEFAULT` is used when `general -> auto-search` is true and something else than a URL was entered to be opened. Other search engines can be used by prepending the search engine name to the search term, e.g. `:open google qutebrowser`. The string `{}` will be replaced by the search term, use `{{` and `}}` for literal `{`/`}` signs.