aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/mode_find.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts/mode_find.coffee')
-rw-r--r--content_scripts/mode_find.coffee5
1 files changed, 4 insertions, 1 deletions
diff --git a/content_scripts/mode_find.coffee b/content_scripts/mode_find.coffee
index 297c4158..bba457b6 100644
--- a/content_scripts/mode_find.coffee
+++ b/content_scripts/mode_find.coffee
@@ -87,7 +87,7 @@ class FindMode extends Mode
findInPlace: (query) ->
# If requested, restore the scroll position (so that failed searches leave the scroll position unchanged).
- window.scrollTo @scrollX, @scrollY if @options.returnToViewport
+ @checkReturnToViewPort()
FindMode.updateQuery query
# Restore the selection. That way, we're always searching forward from the same place, so we find the right
# match as the user adds matching characters, or removes previously-matched characters. See #1434.
@@ -196,6 +196,9 @@ class FindMode extends Mode
@restoreDefaultSelectionHighlight: -> document.body.classList.remove("vimiumFindMode")
+ checkReturnToViewPort: ->
+ window.scrollTo @scrollX, @scrollY if @options.returnToViewport
+
getCurrentRange = ->
selection = getSelection()
if selection.type == "None"