aboutsummaryrefslogtreecommitdiffstats
path: root/content_scripts
diff options
context:
space:
mode:
authormrmr19932014-04-19 01:46:22 +0100
committermrmr19932014-04-19 01:46:22 +0100
commit0450bec1a279e8d67ea46950397f1de91b1b118c (patch)
tree9e98ddc224e15ebaa5a6cdc87774d31be08ccbac /content_scripts
parent712794cd60608e8d02e6cd5c982bbf73a893f0f5 (diff)
downloadvimium-0450bec1a279e8d67ea46950397f1de91b1b118c.tar.bz2
Add a comment explaining match counting for string searches
Diffstat (limited to 'content_scripts')
-rw-r--r--content_scripts/vimium_frontend.coffee5
1 files changed, 4 insertions, 1 deletions
diff --git a/content_scripts/vimium_frontend.coffee b/content_scripts/vimium_frontend.coffee
index 5ba6fa45..c7cff961 100644
--- a/content_scripts/vimium_frontend.coffee
+++ b/content_scripts/vimium_frontend.coffee
@@ -555,8 +555,11 @@ updateFindModeQuery = ->
findModeQuery.regexMatches = text.match(pattern)
findModeQuery.activeRegexIndex = 0
findModeQuery.matchCount = findModeQuery.regexMatches?.length
+ # if we are doing a basic plain string match, we still want to grep for matches of the string, so we can
+ # show a the number of results. We can grep on document.body.innerText, as it should be indistinguishable
+ # from the internal representation used by window.find.
else
- # escape all special characters, so RegExp just parses the string
+ # escape all special characters, so RegExp just parses the string 'as is'.
parsedNonRegexQuery = findModeQuery.parsedQuery.replace("\\", "\\\\")
.replace("^", "\\^")
.replace("$", "\\$")