From 589e8e9d05c85d75578adbadc7d21add302d18e5 Mon Sep 17 00:00:00 2001 From: Jean-Christophe Petkovich Date: Sun, 25 Oct 2015 21:17:48 -0400 Subject: [PATCH 1/2] Flexible Link Hint Filtering I think it makes more sense to filter for any text within a link rather than just the text at the beginning. I've been playing around with this a little and I like it a lot better. When using numbers as link hints, It would be awesome if the link hint strings themselves could also be updated based on how many links are left, but I'm still figuring out how to do this. What do you think? --- qutebrowser/browser/hints.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index e3b3592db..009fc8650 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -864,7 +864,7 @@ class HintManager(QObject): for elems in self._context.elems.values(): try: if (filterstr is None or - str(elems.elem).lower().startswith(filterstr)): + filterstr.casefold() in str(elems.elem).casefold()): if self._is_hidden(elems.label): # hidden element which matches again -> show it self._show_elem(elems.label) From a1ade585576519ac2b773b50104e04627a55c10b Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Mon, 26 Oct 2015 07:00:45 +0100 Subject: [PATCH 2/2] Update docs. --- CHANGELOG.asciidoc | 2 ++ README.asciidoc | 1 + 2 files changed, 3 insertions(+) diff --git a/CHANGELOG.asciidoc b/CHANGELOG.asciidoc index 54539503c..9b005368e 100644 --- a/CHANGELOG.asciidoc +++ b/CHANGELOG.asciidoc @@ -57,6 +57,8 @@ Changed `$XDG_DATA_DIR`. Using a binary in `$PATH` won't work anymore with `--userscript`. - New design for error pages +- Link filtering for hints now checks if the text is contained anywhere in + the link, and matches case-insensitively. Fixed ~~~~~ diff --git a/README.asciidoc b/README.asciidoc index 1b0a186df..0a2687409 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -178,6 +178,7 @@ Contributors, sorted by the number of commits in descending order: * Tim Harder * Thiago Barroso Perrotta * Matthias Lisin +* Jean-Christophe Petkovich * Helen Sherwood-Taylor * HalosGhost * Gregor Pohl