   constructor: (options = {}) ->
     @historyIndex = -1
     @partialQuery = ""
-    @scrollX = window.scrollX
-    @scrollY = window.scrollY
+    if options.returnToViewport
+      @scrollX = window.scrollX
+      @scrollY = window.scrollY
     super
       name: "find"
       badge: "/"

  selection.addRange range

# Enters find mode.  Returns the new find-mode instance.
# Experimental.  Try "returnToViewport: true" for *all* find operations.
window.enterFindMode = (options = { returnToViewport: true }) ->
  # Save the selection, so performFindInPlace can restore it.
  findModeSaveSelection()
  findModeQuery = { rawQuery: "" }

        handlerStack.neverContinueBubbling =>
          if event.keyCode > 31
            keyChar = String.fromCharCode event.charCode
            handleKeyCharForFindMode keyChar if keyChar

      keyup: (event) => @suppressEvent
