aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authormrmr19932015-05-29 14:48:03 +0100
committermrmr19932015-06-10 17:21:23 +0100
commit0d8623e3fe19cc2a1c52f94dfa2a5b5d2dad8352 (patch)
treece8a9bb7f55fb8b6798f1cfefbfd146e8843e79e
parent6ebc5ad32c26841ffe49895b5afc9b3792f68f4e (diff)
downloadvimium-0d8623e3fe19cc2a1c52f94dfa2a5b5d2dad8352.tar.bz2
Replace   with normal spaces for HUD find mode
This keeps searches with trailing spaces from missing matches where the page contains normal spaces, preventing " (No matches)" being shown every time space is pressed.
-rw-r--r--pages/hud.coffee9
1 files changed, 6 insertions, 3 deletions
diff --git a/pages/hud.coffee b/pages/hud.coffee
index c5a4130d..01abba74 100644
--- a/pages/hud.coffee
+++ b/pages/hud.coffee
@@ -13,7 +13,8 @@ document.addEventListener "keydown", (event) ->
UIComponentServer.postMessage
name: "hideFindMode"
event: transferrableEvent
- query: inputElement.textContent
+ # Replace \u00A0 ( ) with a normal space.
+ query: inputElement.textContent.replace "\u00A0", " "
handlers =
show: (data) ->
@@ -38,14 +39,16 @@ handlers =
hud.appendChild inputElement
inputElement.addEventListener "input", (event) ->
- UIComponentServer.postMessage {name: "search", query: inputElement.textContent}
+ # Replace \u00A0 ( ) with a normal space.
+ UIComponentServer.postMessage {name: "search", query: inputElement.textContent.replace "\u00A0", " "}
countElement = document.createElement "span"
countElement.id = "hud-match-count"
hud.appendChild countElement
inputElement.focus()
- UIComponentServer.postMessage {name: "search", query: inputElement.textContent}
+ # Replace \u00A0 ( ) with a normal space.
+ UIComponentServer.postMessage {name: "search", query: inputElement.textContent.replace "\u00A0", " "}
updateMatchesCount: ({matchCount, showMatchText}) ->
countElement = document.getElementById "hud-match-count"