From 832be3c2059870e0930ece3ea88377034e237119 Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 17 May 2015 09:03:05 +0100 Subject: TabToOpen: reactivate previous custom search engine. Note: There's still an unpleasant flicker when this happens. TBD: Fix this. --- background_scripts/completion.coffee | 4 ++-- pages/vomnibar.coffee | 6 +++++- 2 files changed, 7 insertions(+), 3 deletions(-) diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index be37a1fa..25c31be1 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -550,12 +550,12 @@ class SearchEngineCompleter return unless request.searchEngines engines = (engine for _, engine of request.searchEngines) engines.sort (a,b) -> b.searchUrl.length - a.searchUrl.length - engines.push insertTextPrefix: "", searchUrl: Settings.get "searchUrl" + engines.push insertTextPrefix: null, searchUrl: Settings.get "searchUrl" for suggestion in suggestions unless suggestion.isSearchSuggestion or suggestion.insertText for engine in engines if suggestion.insertText = Utils.extractQuery engine.searchUrl, suggestion.url - suggestion.insertText = "#{engine.insertTextPrefix}#{suggestion.insertText}" + suggestion.insertPrefixOnInput = engine.insertTextPrefix suggestion.title = suggestion.insertText suggestion.type = engine.description ? "search" break diff --git a/pages/vomnibar.coffee b/pages/vomnibar.coffee index 18ad5945..2caec140 100644 --- a/pages/vomnibar.coffee +++ b/pages/vomnibar.coffee @@ -195,11 +195,15 @@ class VomnibarUI updateOnInput: => @completer.cancel() + updateSynchronously = false + if 0 < @selection and @completions[@selection].insertPrefixOnInput + @input.value = @completions[@selection].insertPrefixOnInput + @input.value + updateSynchronously = true # If the user types, then don't reset any previous text, and reset the selection. if @previousInputValue? @previousInputValue = null @selection = -1 - @update false + @update updateSynchronously clearUpdateTimer: -> if @updateTimer? -- cgit v1.2.3