From 4dc54f881cf87109025366c40a9e17cdb3507551 Mon Sep 17 00:00:00 2001 From: Martin Tournoij Date: Fri, 29 May 2015 23:24:13 +0200 Subject: [PATCH 1/2] Give a better error when wrapping on search Previously, it just said "Text not found" when you hit the bottom. --- qutebrowser/browser/webview.py | 23 ++++++++++++++++++----- 1 file changed, 18 insertions(+), 5 deletions(-) diff --git a/qutebrowser/browser/webview.py b/qutebrowser/browser/webview.py index a215a1245..51a266949 100644 --- a/qutebrowser/browser/webview.py +++ b/qutebrowser/browser/webview.py @@ -487,12 +487,25 @@ class WebView(QWebView): old_scroll_pos = self.scroll_pos flags = QWebPage.FindFlags(flags) found = self.findText(text, flags) - if not found and not flags & QWebPage.HighlightAllOccurrences and text: - message.error(self.win_id, "Text '{}' not found on " - "page!".format(text), immediately=True) - else: - backward = int(flags) & QWebPage.FindBackward + backward = int(flags) & QWebPage.FindBackward + if not found and not flags & QWebPage.HighlightAllOccurrences and text: + # User disabled wrapping; but findText() just returns False. If we + # have a selection, we know there's a match *somewhere* on the page + if (not flags & QWebPage.FindWrapsAroundDocument and + self.hasSelection()): + if not backward: + message.warning(self.win_id, "Search hit BOTTOM without " + "match for: {}".format(text), + immediately=True) + else: + message.warning(self.win_id, "Search hit TOP without " + "match for: {}".format(text), + immediately=True) + else: + message.error(self.win_id, "Text '{}' not found on " + "page!".format(text), immediately=True) + else: def check_scroll_pos(): """Check if the scroll position got smaller and show info.""" if not backward and self.scroll_pos < old_scroll_pos: From b501677c0e0e1dc519656c9eb552c0400b943cee Mon Sep 17 00:00:00 2001 From: Florian Bruhin Date: Sat, 30 May 2015 22:48:24 +0200 Subject: [PATCH 2/2] Regenerate authors --- README.asciidoc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.asciidoc b/README.asciidoc index aa94eef98..c651ffc33 100644 --- a/README.asciidoc +++ b/README.asciidoc @@ -144,10 +144,10 @@ Contributors, sorted by the number of commits in descending order: * John ShaggyTwoDope Jenkins * Jimmy * Zach-Button +* Martin Tournoij * rikn00 * Patric Schmitz * Martin Zimmermann -* Martin Tournoij * Error 800 * Brian Jackson * sbinix