Merge pull request #455 from ueokande/fix-bookmark-limitation
Limit bookmark items on completion
This commit is contained in:
		
						commit
						1b77846382
					
				
					 2 changed files with 7 additions and 6 deletions
				
			
		| 
						 | 
				
			
			@ -2,7 +2,7 @@
 | 
			
		|||
  "manifest_version": 2,
 | 
			
		||||
  "name": "Vim Vixen",
 | 
			
		||||
  "description": "Vim Vixen",
 | 
			
		||||
  "version": "0.17",
 | 
			
		||||
  "version": "0.18",
 | 
			
		||||
  "icons": {
 | 
			
		||||
    "48": "resources/icon_48x48.png",
 | 
			
		||||
    "96": "resources/icon_96x96.png"
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
| 
						 | 
				
			
			@ -183,10 +183,11 @@ export default class CompletionsInteractor {
 | 
			
		|||
 | 
			
		||||
  async queryBookmarkItems(name, keywords) {
 | 
			
		||||
    let bookmarks = await this.completionRepository.queryBookmarks(keywords);
 | 
			
		||||
    return bookmarks.map(page => new CompletionItem({
 | 
			
		||||
      caption: page.title,
 | 
			
		||||
      content: name + ' ' + page.url,
 | 
			
		||||
      url: page.url
 | 
			
		||||
    }));
 | 
			
		||||
    return bookmarks.slice(0, COMPLETION_ITEM_LIMIT)
 | 
			
		||||
      .map(page => new CompletionItem({
 | 
			
		||||
        caption: page.title,
 | 
			
		||||
        content: name + ' ' + page.url,
 | 
			
		||||
        url: page.url
 | 
			
		||||
      }));
 | 
			
		||||
  }
 | 
			
		||||
}
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Reference in a new issue