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/3] 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/3] 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/3] 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

+ +