aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Blott2016-04-17 09:35:47 +0100
committerStephen Blott2016-04-17 09:35:49 +0100
commitc4850e7bfa5b894f448d06919f902b7e888b2cc0 (patch)
tree55ced0e090ff4eea4703b4b7711eda0666e11aab
parent7e5b2dc0ca85f28c5aebce8686f6e7900ddf94f6 (diff)
downloadvimium-c4850e7bfa5b894f448d06919f902b7e888b2cc0.tar.bz2
There's no need for a new suggestion property...
We do not need "displayUrl", we can re-use "shortUrl" instead. It does what we need already.
-rw-r--r--background_scripts/completion.coffee12
1 files changed, 5 insertions, 7 deletions
diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee
index 5ceb515f..7cd47a00 100644
--- a/background_scripts/completion.coffee
+++ b/background_scripts/completion.coffee
@@ -146,8 +146,6 @@ class Suggestion
# Simplify a suggestion's URL (by removing those parts which aren't useful for display or comparison).
shortenUrl: () ->
- # If we already have display URL, then use it.
- @shortUrl ?= @displayUrl
return @shortUrl if @shortUrl?
# We get easier-to-read shortened URLs if we URI-decode them.
url = (Utils.decodeURIByParts(@url) || @url).toLowerCase()
@@ -207,8 +205,8 @@ class BookmarkCompleter
@bookmarks.filter (bookmark) =>
suggestionTitle = if usePathAndTitle then bookmark.pathAndTitle else bookmark.title
bookmark.hasJavascriptPrefix ?= Utils.hasJavascriptPrefix bookmark.url
- bookmark.displayUrl ?= "javascript:..." if bookmark.hasJavascriptPrefix
- suggestionUrl = bookmark.displayUrl ? bookmark.url
+ bookmark.shortUrl ?= "javascript:..." if bookmark.hasJavascriptPrefix
+ suggestionUrl = bookmark.shortUrl ? bookmark.url
RankingUtils.matches(@currentSearch.queryTerms, suggestionUrl, suggestionTitle)
else
[]
@@ -219,8 +217,8 @@ class BookmarkCompleter
url: bookmark.url
title: if usePathAndTitle then bookmark.pathAndTitle else bookmark.title
relevancyFunction: @computeRelevancy
- displayUrl: bookmark.displayUrl
- deDuplicate: not bookmark.displayUrl?
+ shortUrl: bookmark.shortUrl
+ deDuplicate: not bookmark.shortUrl?
onComplete = @currentSearch.onComplete
@currentSearch = null
onComplete suggestions
@@ -255,7 +253,7 @@ class BookmarkCompleter
bookmark.children.forEach((child) => @traverseBookmarksRecursive child, results, bookmark) if bookmark.children
computeRelevancy: (suggestion) ->
- RankingUtils.wordRelevancy(suggestion.queryTerms, suggestion.displayUrl ? suggestion.url, suggestion.title)
+ RankingUtils.wordRelevancy(suggestion.queryTerms, suggestion.shortUrl ? suggestion.url, suggestion.title)
class HistoryCompleter
filter: ({ queryTerms, seenTabToOpenCompletionList }, onComplete) ->