From 72b854049b80c8d0288698aa8111f62239ffa252 Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Wed, 9 Jul 2014 21:14:15 +0200 Subject: [PATCH] Improvments for hints/page-prev/page-next --- doc/BUGS | 2 -- qutebrowser/browser/hints.py | 2 +- qutebrowser/config/configdata.py | 7 +++---- qutebrowser/utils/webelem.py | 8 ++++---- 4 files changed, 8 insertions(+), 11 deletions(-) diff --git a/doc/BUGS b/doc/BUGS index f9c47c8b1..dd38c0eba 100644 --- a/doc/BUGS +++ b/doc/BUGS @@ -5,8 +5,6 @@ Bugs e.g. loading a page and immediately yanking the (non-resolved) URL should work. -- page-forward clicks "Newest" on http://explosm.net/ instead of "Next". - - seir sometimes sees "-- COMMAND MODE --" even though that should never happen. diff --git a/qutebrowser/browser/hints.py b/qutebrowser/browser/hints.py index 93d0d0600..cd0bbfbd7 100644 --- a/qutebrowser/browser/hints.py +++ b/qutebrowser/browser/hints.py @@ -375,7 +375,7 @@ class HintManager(QObject): return None for regex in config.get('hints', option): for e in elems: - if regex.match(e.toPlainText()): + if regex.search(e.toPlainText()): return e return None diff --git a/qutebrowser/config/configdata.py b/qutebrowser/config/configdata.py index 22298de9c..b8e347a63 100644 --- a/qutebrowser/config/configdata.py +++ b/qutebrowser/config/configdata.py @@ -576,14 +576,13 @@ DATA = OrderedDict([ ('next-regexes', SettingValue(types.RegexList(flags=re.IGNORECASE), - r'\bnext\b,\bmore\b,\bnewer\b,^>$$,^(>>|»|→|≫)$$,' - r'^(>|»|→|≫),(>|»|→|≫)$$'), + r'\bnext\b,\bmore\b,\bnewer\b,\b[>→≫]\b,\b(>>|»)\b'), "A comma-separated list of regexes to use for 'next' links."), ('prev-regexes', SettingValue(types.RegexList(flags=re.IGNORECASE), - r'\bprev(ious)\b,\bback\b,\bolder\b,^<$$,^(<<|«|←|≪)$$,' - r'^(<|«|←|≪),(<|«|←|≪)$$'), + r'\bprev(ious)?\b,\bback\b,\bolder\b,\b[<←≪]\b,' + r'\b(<<|«)\b'), "A comma-separated list of regexes to use for 'prev' links."), )), diff --git a/qutebrowser/utils/webelem.py b/qutebrowser/utils/webelem.py index 89007c920..6e27c24ce 100644 --- a/qutebrowser/utils/webelem.py +++ b/qutebrowser/utils/webelem.py @@ -40,10 +40,10 @@ Group = enum('all', 'links', 'images', 'editable', 'url', 'prevnext_rel', SELECTORS = { - Group.all: ('a, textarea, select, input:not([type=hidden]), button, ' + Group.all: ('a, area, textarea, select, input:not([type=hidden]), button, ' 'frame, iframe, [onclick], [onmousedown], [role=link], ' '[role=option], [role=button], img'), - Group.links: 'a', + Group.links: 'a, area, link', Group.images: 'img', # This doesn't contain all the groups where we should switch to insert mode # - it is just used when opening the external editor. @@ -56,8 +56,8 @@ SELECTORS = { 'input[type=search]:focus, ' 'textarea:focus'), Group.url: '[src], [href]', - Group.prevnext_rel: 'link, [role=link]', - Group.prevnext: 'a, button, [role=button]', + Group.prevnext_rel: 'a, area, link, [role=link]', + Group.prevnext: 'a, area, button, [role=button]', } FILTERS = {