diff --git a/qutebrowser/browser/commands.py b/qutebrowser/browser/commands.py index fd2c61963..cf431c99c 100644 --- a/qutebrowser/browser/commands.py +++ b/qutebrowser/browser/commands.py @@ -1415,6 +1415,7 @@ class CommandDispatcher: text: The text to search for. reverse: Reverse search direction. """ + self.set_mark("'") view = self._current_widget() self._clear_search(view, text) flags = 0 @@ -1445,6 +1446,7 @@ class CommandDispatcher: Args: count: How many elements to ignore. """ + self.set_mark("'") view = self._current_widget() self._clear_search(view, self._tabbed_browser.search_text) @@ -1465,6 +1467,7 @@ class CommandDispatcher: Args: count: How many elements to ignore. """ + self.set_mark("'") view = self._current_widget() self._clear_search(view, self._tabbed_browser.search_text) diff --git a/tests/integration/features/marks.feature b/tests/integration/features/marks.feature index 14ab84bfc..85fc76708 100644 --- a/tests/integration/features/marks.feature +++ b/tests/integration/features/marks.feature @@ -69,3 +69,18 @@ Feature: Setting positional marks And I run :follow-hint s And I run :jump-mark "'" Then the page should be scrolled to 0 0 + + Scenario: Jumping back after searching + When I run :hint links normal + And I run :search 48 + And I run :jump-mark "'" + Then the page should be scrolled to 0 0 + + Scenario: Jumping back after search-next + When I run :hint links normal + And I run :search 9 + And I run :search-next + And I run :search-next + And I run :search-next + And I run :jump-mark "'" + Then the page should be scrolled to 0 0