From e64baa4c0acd1e1e87513f0369951dbe8310765b Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 18 Sep 2010 23:13:03 +0000 Subject: 補完修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38487 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'twittperator.js') diff --git a/twittperator.js b/twittperator.js index 220df3f..f2117da 100755 --- a/twittperator.js +++ b/twittperator.js @@ -1766,6 +1766,7 @@ let PLUGIN_INFO = if (m) Twitter.favorite(m[0]); }, + timelineCompleter: true, completer: Completers.id(rejectMine) }), SubCommand({ @@ -1776,6 +1777,7 @@ let PLUGIN_INFO = if (m) Twitter.unfavorite(m[1]); }, + timelineCompleter: true, completer: Completers.name_id_text(rejectMine) }), SubCommand({ @@ -1788,18 +1790,21 @@ let PLUGIN_INFO = Twittperator.showTwitterMentions(); } }, + timelineCompleter: true, completer: Completers.name() }), SubCommand({ command: ["?"], description: "Twitter search", action: function(arg) Twittperator.showTwitterSearchResult(arg), + timelineCompleter: true, completer: Completers.text() }), SubCommand({ command: ["/"], description: "Open link", action: function(arg) Twittperator.openLink(arg), + timelineCompleter: true, completer: Completers.text(function(s) /https?:\/\//(s.text)) }), SubCommand({ @@ -1810,6 +1815,7 @@ let PLUGIN_INFO = if (m) Twitter.destroy(m[0]); }, + timelineCompleter: true, completer: Completers.id(seleceMine) }), SubCommand({ @@ -1832,6 +1838,7 @@ let PLUGIN_INFO = let id = parseInt(m[0], 10); history.filter(function(st) st.id === id).map(dtdd).forEach(liberator.echo); }, + timelineCompleter: true, completer: Completers.id() }), SubCommand({ @@ -1842,7 +1849,7 @@ let PLUGIN_INFO = }, completer: function (context, args) { if (setting.trackWords) - context.completions = [setting.trackWords, "from global variable"]; + context.completions = [[setting.trackWords, "Global variable"]]; } }), ]; // }}} @@ -1875,33 +1882,40 @@ let PLUGIN_INFO = let (desc = item.description) (this.match(desc.user.screen_name) || this.match(desc.text)); - context.createRow = function(item, highlightGroup) { - let desc = item[1] || this.process[1].call(this, item, item.description); + function setTimelineCompleter() { + context.createRow = function(item, highlightGroup) { + let desc = item[1] || this.process[1].call(this, item, item.description); + + if (desc && desc.user) { + return