aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts/vimium_frontend.coffee
diff options
context:
space:
mode:
Diffstat (limited to 'content_scripts/vimium_frontend.coffee')
-rw-r--r--content_scripts/vimium_frontend.coffee22
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)