Merge branch 'fix_hiding_hints' of https://github.com/lahwaacz/qutebrowser into lahwaacz-fix_hiding_hints

This commit is contained in:
Florian Bruhin 2016-08-09 16:42:11 +02:00
commit 809f8e90df
3 changed files with 34 additions and 2 deletions

View File

@ -783,8 +783,11 @@ 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
# 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

View File

@ -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
)),

View File

@ -0,0 +1,25 @@
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8">
<title>Hide unmatched rapid hints</title>
</head>
<body>
<p>When <code>hints -> hide-unmatched-rapid-hints</code> 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 <a href="https://github.com/The-Compiler/qutebrowser/issues/1799">#1799</a>).</p>
<p>Note that when hinting in number mode, the <code>hints -> hide-unmatched-rapid-hints</code> option affects typing the hint string (number), but not the filter (letters).</p>
<p>Here is couple of invalid links to test the behaviour:</p>
<p><a href="#foo">one</a></p>
<p><a href="#foo">two</a></p>
<p><a href="#foo">three</a></p>
<p><a href="#foo">four</a></p>
<p><a href="#foo">five</a></p>
<p><a href="#foo">six</a></p>
<p><a href="#foo">seven</a></p>
<p><a href="#foo">eight</a></p>
<p><a href="#foo">nine</a></p>
<p><a href="#foo">ten</a></p>
<p><a href="#foo">eleven</a></p>
<p><a href="#foo">twelve</a></p>
<p><a href="#foo">thirteen</a></p>
</body>
</html>