diff options
| author | mrmr1993 | 2015-05-20 18:23:34 +0100 |
|---|---|---|
| committer | mrmr1993 | 2015-05-20 18:23:34 +0100 |
| commit | 71b4d21af502bfbb914740c59fc9fb5d0f4957b0 (patch) | |
| tree | 0c4f5ae7b77a4af7074fe6c11831b9b2f69ae21c /content_scripts | |
| parent | e6878dabc61cd97e2ae4bba1ae157961faf007b8 (diff) | |
| download | vimium-71b4d21af502bfbb914740c59fc9fb5d0f4957b0.tar.bz2 | |
Only modify find mode regexps if it's a flag we want to match
Diffstat (limited to 'content_scripts')
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 22 |
1 files changed, 9 insertions, 13 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee index fbe26faa..41fb772b 100644 --- a/content_scripts/vimium_frontend.coffee +++ b/content_scripts/vimium_frontend.coffee @@ -719,19 +719,15 @@ updateFindModeQuery = -> findModeQuery.isRegex = settings.get 'regexFindMode' hasNoIgnoreCaseFlag = false findModeQuery.parsedQuery = findModeQuery.rawQuery.replace /(\\{1,2})([rRI]?)/g, (match, slashes, flag) -> - return match if flag == "" - if slashes.length == 2 - # The escape code is double-escaped (ie. \\r rather than \r). Strip the extra slash. - "\\#{flag}" - else - switch (match) - when "\\r" - findModeQuery.isRegex = true - when "\\R" - findModeQuery.isRegex = false - when "\\I" - hasNoIgnoreCaseFlag = true - "" + return match if flag == "" or slashes.length != 1 + switch (flag) + when "r" + findModeQuery.isRegex = true + when "R" + findModeQuery.isRegex = false + when "I" + hasNoIgnoreCaseFlag = true + "" # default to 'smartcase' mode, unless noIgnoreCase is explicitly specified findModeQuery.ignoreCase = !hasNoIgnoreCaseFlag && !Utils.hasUpperCase(findModeQuery.parsedQuery) |
