diff options
| author | Stephen Blott | 2015-05-11 11:23:54 +0100 | 
|---|---|---|
| committer | Stephen Blott | 2015-05-11 11:23:54 +0100 | 
| commit | 34ced40ea60669110dc9a21d74360f751c87aff0 (patch) | |
| tree | 2e01f974a9c658d5da0548c1480c2d42472bc8be /pages/vomnibar.coffee | |
| parent | cee14fd4be36649aa96bb400ca3c2ed1937b4b5b (diff) | |
| download | vimium-34ced40ea60669110dc9a21d74360f751c87aff0.tar.bz2 | |
Search completion; fix synchronization issue.
Diffstat (limited to 'pages/vomnibar.coffee')
| -rw-r--r-- | pages/vomnibar.coffee | 14 | 
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  | 
