   settings.set("findModeRawQuery", findModeQuery.rawQuery)
 
 performFindInPlace = ->
+  findModeRestoreSelection()
   query = if findModeQuery.isRegex then getNextQueryFromRegexMatches(0) else findModeQuery.parsedQuery
-
-  selection = window.getSelection()
-  selection.collapseToStart() if selection.type == "Range"
-
   findModeQueryHasResults = executeFind(query, { caseSensitive: !findModeQuery.ignoreCase })
 
 # :options is an optional dict. valid parameters are 'caseSensitive' and 'backwards'.

  else
    HUD.show("/" + findModeQuery.rawQuery + " (No Matches)")

window.enterFindMode = ->
  findModeQuery = { rawQuery: "" }
  findMode = true
  HUD.show("/")

findModeQuery = { rawQuery: "", matchCount: 0 }
findModeQueryHasResults = false
findModeAnchorNode = null
findModeInitialRange = null
isShowingHelpDialog = false
keyPort = null
# Users can disable Vimium on URL patterns via the settings page.  The following two variables
