From b06787cfccd129c1cbb55d209bcd10ae0def575d Mon Sep 17 00:00:00 2001 From: Jez Ng Date: Tue, 17 Jan 2012 16:19:56 +0800 Subject: 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. --- vimiumFrontend.js | 12 ++---------- 1 file 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 // ​ is a zero-width space - newQuery = newQuery + query[i] + ""; - } - - return newQuery; + // ​ is a zero-width space + return query.split("").join("​"); } function enterFindMode() { -- cgit v1.2.3