aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhil Crosby2012-05-26 17:26:43 -0700
committerPhil Crosby2012-05-26 22:27:27 -0700
commitf2930565da6d5635f732cac40f1be0126ae994a0 (patch)
tree406307f1e5d57a71e402b4e5108a269ea9358bd4
parent856bec7b4ecf57eed3867696d311ba3f43b32e36 (diff)
downloadvimium-f2930565da6d5635f732cac40f1be0126ae994a0.tar.bz2
Don't render fuzzy matches less than 3 characters in the ui
They're aleady being discarded for ranking purposes.
-rw-r--r--background_scripts/completion.js5
1 files changed, 4 insertions, 1 deletions
diff --git a/background_scripts/completion.js b/background_scripts/completion.js
index 2e78ac9d..f780a22a 100644
--- a/background_scripts/completion.js
+++ b/background_scripts/completion.js
@@ -601,9 +601,12 @@ var completion = (function() {
addToHtml(before + str[i] + after);
}
+ // Don't render matches between the query and the str which are 2 characters are less.
+ var minimumCharacterMatch = 3;
+
// iterate over the match groups. They are non-matched and matched string parts, in alternating order
for (var i = 0; i < groups.length; ++i) {
- if (i % 2 == 0)
+ if (i % 2 == 0 || groups[i].length < minimumCharacterMatch)
// we have a non-matched part, it could have several characters. We need to insert them character
// by character, so that addToHtml can keep track of the position in the original string
addCharsWithDecoration(groups[i]);