diff options
| author | mrmr1993 | 2014-04-19 01:46:22 +0100 |
|---|---|---|
| committer | mrmr1993 | 2014-04-19 01:46:22 +0100 |
| commit | 0450bec1a279e8d67ea46950397f1de91b1b118c (patch) | |
| tree | 9e98ddc224e15ebaa5a6cdc87774d31be08ccbac | |
| parent | 712794cd60608e8d02e6cd5c982bbf73a893f0f5 (diff) | |
| download | vimium-0450bec1a279e8d67ea46950397f1de91b1b118c.tar.bz2 | |
Add a comment explaining match counting for string searches
| -rw-r--r-- | content_scripts/vimium_frontend.coffee | 5 |
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("$", "\\$") |
