aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJez Ng2012-01-17 16:19:56 +0800
committerJez Ng2012-01-25 23:47:55 -0500
commitb06787cfccd129c1cbb55d209bcd10ae0def575d (patch)
tree5d42dc973df97e40bbd89600fae67b83601fd905
parentdf02f36755b57fbc65d0fc2c00ea24870e98093a (diff)
downloadvimium-b06787cfccd129c1cbb55d209bcd10ae0def575d.tar.bz2
Ensure the find mode HUD doesn't match its own searches.
This fixes up the initial attempt at using the zero-width space in commit e1e178b.
-rw-r--r--vimiumFrontend.js12
1 files changed, 2 insertions, 10 deletions
diff --git a/vimiumFrontend.js b/vimiumFrontend.js
index 94290e4e..60a96a3a 100644
--- a/vimiumFrontend.js
+++ b/vimiumFrontend.js
@@ -792,16 +792,8 @@ function showFindModeHUDForQuery() {
* We need this so that the find mode HUD doesn't match its own searches.
*/
function insertSpaces(query) {
- var newQuery = "";
-
- for (var i = 0; i < query.length; i++) {
- if (query[i] == " " || (i + 1 < query.length && query[i + 1] == " "))
- newQuery = newQuery + query[i];
- else // &#8203; is a zero-width space
- newQuery = newQuery + query[i] + "<span>&#8203;</span>";
- }
-
- return newQuery;
+ // &#8203; is a zero-width space
+ return query.split("").join("&#8203");
}
function enterFindMode() {