diff options
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 8 | ||||
| -rw-r--r-- | options/options.coffee | 2 | ||||
| -rw-r--r-- | options/options.html | 14 | 
3 files changed, 21 insertions, 3 deletions
| diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index 22070084..2f30d47a 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -43,7 +43,8 @@ settings =    values: {}    loadedValues: 0    valuesToLoad: ["scrollStepSize", "linkHintCharacters", "filterLinkHints", "hideHud", "previousPatterns", -      "nextPatterns", "findModeRawQuery", "userDefinedLinkHintCss", "helpDialog_showAdvancedCommands"] +      "nextPatterns", "findModeRawQuery", "regexFindMode", "userDefinedLinkHintCss", +      "helpDialog_showAdvancedCommands"]    isLoaded: false    eventListeners: {} @@ -572,13 +573,16 @@ updateFindModeQuery = ->    # the query can be treated differently (e.g. as a plain string versus regex depending on the presence of    # escape sequences. '\' is the escape character and needs to be escaped itself to be used as a normal    # character. here we grep for the relevant escape sequences. -  findModeQuery.isRegex = false +  findModeQuery.isRegex = settings.get 'regexFindMode'    hasNoIgnoreCaseFlag = false    findModeQuery.parsedQuery = findModeQuery.rawQuery.replace /\\./g, (match) ->      switch (match)        when "\\r"          findModeQuery.isRegex = true          return "" +      when "\\R" +        findModeQuery.isRegex = false +        return ""        when "\\I"          hasNoIgnoreCaseFlag = true          return "" diff --git a/options/options.coffee b/options/options.coffee index ffa6bc44..27b08e38 100644 --- a/options/options.coffee +++ b/options/options.coffee @@ -3,7 +3,7 @@ $ = (id) -> document.getElementById id  bgSettings = chrome.extension.getBackgroundPage().Settings  editableFields = ["scrollStepSize", "excludedUrls", "linkHintCharacters", "userDefinedLinkHintCss", -  "keyMappings", "filterLinkHints", "previousPatterns", "nextPatterns", "hideHud"] +  "keyMappings", "filterLinkHints", "previousPatterns", "nextPatterns", "hideHud", "regexFindMode"]  canBeEmptyFields = ["excludedUrls", "keyMappings", "userDefinedLinkHintCss"] diff --git a/options/options.html b/options/options.html index 089de394..d7851c75 100644 --- a/options/options.html +++ b/options/options.html @@ -272,6 +272,20 @@ unmapAll            </td>          </tr>          <tr class="advancedOption"> +          <td class="caption"></td> +          <td verticalAlign="top" class="booleanOption"> +            <div class="help"> +              <div class="example"> +                Switch back to plain find mode by using the <code>\R</code> escape sequence. +              </div> +            </div> +            <label> +              <input id="regexFindMode" type="checkbox"/> +              Treat find queries as regular expressions. +            </label> +          </td> +        </tr> +        <tr class="advancedOption">            <td class="caption">Previous Patterns</td>            <td verticalAlign="top">                <div class="help"> | 
