aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2015-05-11 11:23:54 +0100
committerStephen Blott2015-05-11 11:23:54 +0100
commit34ced40ea60669110dc9a21d74360f751c87aff0 (patch)
tree2e01f974a9c658d5da0548c1480c2d42472bc8be
parentcee14fd4be36649aa96bb400ca3c2ed1937b4b5b (diff)
downloadvimium-34ced40ea60669110dc9a21d74360f751c87aff0.tar.bz2
Search completion; fix synchronization issue.
-rw-r--r--pages/vomnibar.coffee14
1 files changed, 7 insertions, 7 deletions
diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee
index 6268afdd..fed8680b 100644
--- a/pages/vomnibar.coffee
+++ b/pages/vomnibar.coffee
@@ -198,14 +198,19 @@ class VomnibarUI
# Bail if there's an update pending (because then @input and the completion state are out of sync).
return if @updateTimer?
- @previousLength ?= @input.value.length
+ value = @getInputWithoutSelectionRange()
+ @previousLength ?= value.length
previousLength = @previousLength
- currentLength = @input.value.length
+ currentLength = value.length
@previousLength = currentLength
# We only highlight matches when the query gets longer (so, not on deletions).
return unless previousLength < currentLength
+ # Bail on leading whitespace or on redundant whitespace. This provides users with a way to force this
+ # feature off.
+ return if /^\s/.test(value) or /\s\s/.test value
+
completion = do (completion) =>
for completion in @completions
continue if completion.custonSearchEnginePrimarySuggestion
@@ -214,11 +219,6 @@ class VomnibarUI
return unless completion
- # Bail on leading whitespace or on redundant whitespace. This provides users with a way to force this
- # feature off.
- value = @input.value
- return if /^\s/.test(value) or /\s\s/.test value
-
# Fetch the query and the suggestion texts.
query = value.ltrim().split(/\s+/).join(" ").toLowerCase()
suggestion = completion.title