aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/marks.coffee7
1 files changed, 5 insertions, 2 deletions
diff --git a/content_scripts/marks.coffee b/content_scripts/marks.coffee
index fb1d1b1d..3690908d 100644
--- a/content_scripts/marks.coffee
+++ b/content_scripts/marks.coffee
@@ -15,7 +15,7 @@ Marks =
"vimiumMark|#{window.location.href.split('#')[0]}|#{keyChar}"
getMarkString: ->
- JSON.stringify scrollX: window.scrollX, scrollY: window.scrollY
+ JSON.stringify scrollX: window.scrollX, scrollY: window.scrollY, hash: window.location.hash
setPreviousPosition: ->
markString = @getMarkString()
@@ -84,7 +84,10 @@ Marks =
if markString?
@setPreviousPosition()
position = JSON.parse markString
- window.scrollTo position.scrollX, position.scrollY
+ if position.hash and position.scrollX == 0 and position.scrollY == 0
+ window.location.hash = position.hash
+ else
+ window.scrollTo position.scrollX, position.scrollY
@showMessage "Jumped to local mark", keyChar
else
@showMessage "Local mark not set", keyChar