Only set the ' mark on normal/current hinting.

Don't set ' for downloading, hovering, or opening a link in a tab.
This commit is contained in:
Ryan Roden-Corrent 2016-04-19 20:46:45 -04:00
parent 268d490e25
commit 0755e163bb
2 changed files with 15 additions and 4 deletions

View File

@ -466,6 +466,13 @@ class HintManager(QObject):
QMouseEvent(QEvent.MouseButtonRelease, pos, Qt.LeftButton,
Qt.NoButton, modifiers),
]
if context.target in [Target.normal, Target.current]:
# Set the pre-jump mark ', so we can jump back here after following
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
tabbed_browser.set_mark("'")
if context.target == Target.current:
elem.remove_blank_target()
for evt in events:
@ -921,10 +928,6 @@ class HintManager(QObject):
immediately=True)
return
if self._context.target in elem_handlers:
# Set the pre-jump mark ', so we can jump back here after following
tabbed_browser = objreg.get('tabbed-browser', scope='window',
window=self._win_id)
tabbed_browser.set_mark("'")
handler = functools.partial(
elem_handlers[self._context.target], elem, self._context)
elif self._context.target in url_handlers:

View File

@ -81,3 +81,11 @@ Feature: Setting positional marks
And I run :search-next
And I run :jump-mark "'"
Then the page should be scrolled to 0 0
Scenario: Hovering a hint does not set the ' mark
When I run :scroll-px 30 20
And I run :scroll-perc 0
And I run :hint links hover
And I run :follow-hint s
And I run :jump-mark "'"
Then the page should be scrolled to 30 20