Merge branch 'lahwaacz-fix_hiding_hints'

This commit is contained in:
Florian Bruhin 2016-08-09 16:45:23 +02:00
commit 1980dbb529
6 changed files with 49 additions and 3 deletions

View File

@ -28,6 +28,8 @@ Added
completion category headers. completion category headers.
- New `:debug-log-capacity` command to adjust how many lines are logged into RAM - New `:debug-log-capacity` command to adjust how many lines are logged into RAM
(to report bugs which are difficult to reproduce). (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 Changed
~~~~~~~ ~~~~~~~

View File

@ -147,8 +147,8 @@ Contributors, sorted by the number of commits in descending order:
* Bruno Oliveira * Bruno Oliveira
* Alexander Cogneau * Alexander Cogneau
* Marshall Lochbaum * Marshall Lochbaum
* Felix Van der Jeugt
* Jakub Klinkovský * Jakub Klinkovský
* Felix Van der Jeugt
* Martin Tournoij * Martin Tournoij
* Jan Verbeek * Jan Verbeek
* Raphael Pierzina * Raphael Pierzina

View File

@ -190,6 +190,7 @@
|<<hints-next-regexes,next-regexes>>|A comma-separated list of regexes to use for 'next' links. |<<hints-next-regexes,next-regexes>>|A comma-separated list of regexes to use for 'next' links.
|<<hints-prev-regexes,prev-regexes>>|A comma-separated list of regexes to use for 'prev' links. |<<hints-prev-regexes,prev-regexes>>|A comma-separated list of regexes to use for 'prev' links.
|<<hints-find-implementation,find-implementation>>|Which implementation to use to find elements to hint. |<<hints-find-implementation,find-implementation>>|Which implementation to use to find elements to hint.
|<<hints-hide-unmatched-rapid-hints,hide-unmatched-rapid-hints>>|Controls hiding unmatched hints in rapid mode.
|============== |==============
.Quick reference for section ``colors'' .Quick reference for section ``colors''
@ -1698,6 +1699,17 @@ Valid values:
Default: +pass:[python]+ 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 == searchengines
Definitions of search engines which can be used via the address bar. 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. 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.

View File

@ -783,8 +783,11 @@ class HintManager(QObject):
# hidden element which matches again -> show it # hidden element which matches again -> show it
self._show_elem(elem.label) self._show_elem(elem.label)
else: else:
# element doesn't match anymore -> hide it # element doesn't match anymore -> hide it, unless in rapid
self._hide_elem(elem.label) # 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: except webelem.Error:
pass pass

View File

@ -956,6 +956,10 @@ def data(readonly=False):
)), 'python'), )), 'python'),
"Which implementation to use to find elements to hint."), "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 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>