From 45f6cf01c30261aa4ce983dd7dd4747018943938 Mon Sep 17 00:00:00 2001 From: Philipp Albrecht Date: Sun, 2 Jul 2023 13:04:14 +0200 Subject: Don't show warning when jumping to next/prev without matches --- qutebrowser/browser/commands.py | 3 +-- tests/end2end/features/search.feature | 16 ++++++++++++++++ 2 files changed, 17 insertions(+), 2 deletions(-) diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index 3b38c44c0..410b844a0 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1597,8 +1597,7 @@ class CommandDispatcher: def _search_navigation_cb(self, result): """Callback called from :search-prev/next.""" if result == browsertab.SearchNavigationResult.not_found: - # FIXME check if this actually can happen... - message.warning("Search result vanished...") + self._search_cb(found=False, text=self._tabbed_browser.search_text) return elif result == browsertab.SearchNavigationResult.found: return diff --git a/tests/end2end/features/search.feature b/tests/end2end/features/search.feature index 62b409a19..aad8f2792 100644 --- a/tests/end2end/features/search.feature +++ b/tests/end2end/features/search.feature @@ -147,6 +147,14 @@ Feature: Searching on a page And I run :search-next Then the error "No search done yet." should be shown + # https://github.com/qutebrowser/qutebrowser/issues/7275 + @qtwebkit_skip + Scenario: Jumping to next without matches + When I run :search doesnotmatch + And I wait for the warning "Text 'doesnotmatch' not found on page!" + And I run :search-next + Then the warning "Text 'doesnotmatch' not found on page!" should be shown + Scenario: Repeating search in a second tab (issue #940) When I open data/search.html in a new tab And I run :search foo @@ -222,6 +230,14 @@ Feature: Searching on a page And I run :search-prev Then the error "No search done yet." should be shown + # https://github.com/qutebrowser/qutebrowser/issues/7275 + @qtwebkit_skip + Scenario: Jumping to previous without matches + When I run :search doesnotmatch + And I wait for the warning "Text 'doesnotmatch' not found on page!" + And I run :search-prev + Then the warning "Text 'doesnotmatch' not found on page!" should be shown + ## wrapping Scenario: Wrapping around page -- cgit v1.2.3-54-g00ecf