 
   container.innerHTML = html
   container.getElementsByClassName("closeButton")[0].addEventListener("click", hideHelpDialog, false)
-  
+
   VimiumHelpDialog =
     # This setting is pulled out of local storage. It's false by default.
     getShowAdvancedCommands: -> settings.get("helpDialog_showAdvancedCommands")


showFindModeHUDForQuery = ->
  if (findModeQueryHasResults || findModeQuery.parsedQuery.length == 0)
    HUD.show("/" + findModeQuery.rawQuery)
  else
    HUD.show("/" + findModeQuery.rawQuery + " (No Matches)")


    text = document.body.innerText
    findModeQuery.regexMatches = text.match(pattern)
    findModeQuery.activeRegexIndex = 0
    findModeQuery.matchCount = findModeQuery.regexMatches?.length
  else
    # escape all special characters, so RegExp just parses the string
    parsedNonRegexQuery = findModeQuery.parsedQuery.replace("\\", "\\\\")
                                                   .replace("^", "\\^")
                                                   .replace("$", "\\$")
                                                   .replace("*", "\\*")
                                                   .replace("+", "\\+")
                                                   .replace("?", "\\?")
                                                   .replace("(", "\\(")
                                                   .replace(")", "\\)")
                                                   .replace("|", "\\|")
                                                   .replace("{", "\\{")
                                                   .replace("}", "\\}")
                                                   .replace("[", "\\[")
                                                   .replace("]", "\\]")
    pattern = new RegExp(parsedNonRegexQuery, "g" + (if findModeQuery.ignoreCase then "i" else ""))
    text = document.body.innerText
    findModeQuery.matchCount = text.match(pattern)?.length

handleKeyCharForFindMode = (keyChar) ->
  findModeQuery.rawQuery += keyChar
