Set ' mark after searching.
Allow jumping back to the previous position after a search jumps you around.
This commit is contained in:
parent
4b00a17d71
commit
a924144d9a
@ -1415,6 +1415,7 @@ class CommandDispatcher:
|
|||||||
text: The text to search for.
|
text: The text to search for.
|
||||||
reverse: Reverse search direction.
|
reverse: Reverse search direction.
|
||||||
"""
|
"""
|
||||||
|
self.set_mark("'")
|
||||||
view = self._current_widget()
|
view = self._current_widget()
|
||||||
self._clear_search(view, text)
|
self._clear_search(view, text)
|
||||||
flags = 0
|
flags = 0
|
||||||
@ -1445,6 +1446,7 @@ class CommandDispatcher:
|
|||||||
Args:
|
Args:
|
||||||
count: How many elements to ignore.
|
count: How many elements to ignore.
|
||||||
"""
|
"""
|
||||||
|
self.set_mark("'")
|
||||||
view = self._current_widget()
|
view = self._current_widget()
|
||||||
|
|
||||||
self._clear_search(view, self._tabbed_browser.search_text)
|
self._clear_search(view, self._tabbed_browser.search_text)
|
||||||
@ -1465,6 +1467,7 @@ class CommandDispatcher:
|
|||||||
Args:
|
Args:
|
||||||
count: How many elements to ignore.
|
count: How many elements to ignore.
|
||||||
"""
|
"""
|
||||||
|
self.set_mark("'")
|
||||||
view = self._current_widget()
|
view = self._current_widget()
|
||||||
self._clear_search(view, self._tabbed_browser.search_text)
|
self._clear_search(view, self._tabbed_browser.search_text)
|
||||||
|
|
||||||
|
@ -69,3 +69,18 @@ Feature: Setting positional marks
|
|||||||
And I run :follow-hint s
|
And I run :follow-hint s
|
||||||
And I run :jump-mark "'"
|
And I run :jump-mark "'"
|
||||||
Then the page should be scrolled to 0 0
|
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
|
||||||
|
Loading…
Reference in New Issue
Block a user