Merge pull request #455 from ueokande/fix-bookmark-limitation

Limit bookmark items on completion
jh-changes
Shin'ya Ueoka 6 years ago committed by GitHub
commit 1b77846382
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      manifest.json
  2. 11
      src/background/usecases/completions.js

@ -2,7 +2,7 @@
"manifest_version": 2, "manifest_version": 2,
"name": "Vim Vixen", "name": "Vim Vixen",
"description": "Vim Vixen", "description": "Vim Vixen",
"version": "0.17", "version": "0.18",
"icons": { "icons": {
"48": "resources/icon_48x48.png", "48": "resources/icon_48x48.png",
"96": "resources/icon_96x96.png" "96": "resources/icon_96x96.png"

@ -183,10 +183,11 @@ export default class CompletionsInteractor {
async queryBookmarkItems(name, keywords) { async queryBookmarkItems(name, keywords) {
let bookmarks = await this.completionRepository.queryBookmarks(keywords); let bookmarks = await this.completionRepository.queryBookmarks(keywords);
return bookmarks.map(page => new CompletionItem({ return bookmarks.slice(0, COMPLETION_ITEM_LIMIT)
caption: page.title, .map(page => new CompletionItem({
content: name + ' ' + page.url, caption: page.title,
url: page.url content: name + ' ' + page.url,
})); url: page.url
}));
} }
} }