From a1467b3f0ff2f7e3703edb032909980454763f1b Mon Sep 17 00:00:00 2001 From: Stephen Blott Date: Sun, 18 May 2014 12:48:55 +0100 Subject: Require bookmark folder separator to be first character of a query term. --- background_scripts/completion.coffee | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'background_scripts/completion.coffee') diff --git a/background_scripts/completion.coffee b/background_scripts/completion.coffee index fb3356da..54b94eb5 100644 --- a/background_scripts/completion.coffee +++ b/background_scripts/completion.coffee @@ -114,9 +114,9 @@ class BookmarkCompleter onBookmarksLoaded: -> @performSearch() if @currentSearch performSearch: -> - # If the folder separator character is in the query, then we'll use the bookmark's full path as its title. + # If the folder separator character the first character in any query term, then we'll use the bookmark's full path as its title. # Otherwise, we'll just use the its regular title. - usePathAndTitle = @currentSearch.queryTerms.reduce ((prev,term) => prev || term.indexOf(@folderSeparator) != -1), false + usePathAndTitle = @currentSearch.queryTerms.reduce ((prev,term) => prev || term.indexOf(@folderSeparator) == 0), false results = if @currentSearch.queryTerms.length > 0 @bookmarks.filter (bookmark) => -- cgit v1.2.3