diff options
author | anekos | 2008-11-23 00:35:01 +0000 |
---|---|---|
committer | anekos | 2008-11-23 00:35:01 +0000 |
commit | 00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b (patch) | |
tree | 0030344502fe3b267f13964659ad43160629ae9a /nico_related_videos.js | |
parent | c9148677771aa64b1169866b9631a2b5946ca79e (diff) | |
download | vimperator-plugins-00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b.tar.bz2 |
follow the new completer.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@24676 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'nico_related_videos.js')
-rw-r--r-- | nico_related_videos.js | 11 |
1 files changed, 6 insertions, 5 deletions
diff --git a/nico_related_videos.js b/nico_related_videos.js index d6a3eea..e0779af 100644 --- a/nico_related_videos.js +++ b/nico_related_videos.js @@ -94,17 +94,18 @@ }, { bang: true, - completer: function (args) { - if (buffer.URL != last.url) { + completer: function (context, arg, bang) { + if ((buffer.URL != last.url) || !last.completions.length) { last.completions = []; getRelatedVideos().forEach(function (it) last.completions.push([it.url, it.title])); getRelatedTags().forEach(function (it) last.completions.push([":" + it, "tag"])); last.url = buffer.URL; } - return [0, last.completions.length ? completion.filter(last.completions, args) - : [[nothing, nothing]]]; + context.title = ['Keyword']; + context.items = completion.filter(last.completions, context.filter); } - } + }, + true ); })(); |