aboutsummaryrefslogtreecommitdiffstats
path: root/nico_related_videos.js
diff options
context:
space:
mode:
authoranekos2008-11-23 00:35:01 +0000
committeranekos2008-11-23 00:35:01 +0000
commit00b1f584a13c4cae8b0b84b6e3ffc67f7b9d037b (patch)
tree0030344502fe3b267f13964659ad43160629ae9a /nico_related_videos.js
parentc9148677771aa64b1169866b9631a2b5946ca79e (diff)
downloadvimperator-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.js11
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
);
})();