From e99b09d26879df9339db850c9238a42d68688ae4 Mon Sep 17 00:00:00 2001 From: anekos Date: Sat, 31 Jul 2010 21:11:48 +0000 Subject: 履歴サイズ修正時に残念な事になるのを修正 git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38110 d0d07461-0603-4401-acd4-de1884942a52 --- twittperator.js | 22 ++++++++++++++++++---- 1 file changed, 18 insertions(+), 4 deletions(-) diff --git a/twittperator.js b/twittperator.js index 44a97ad..7757e3e 100755 --- a/twittperator.js +++ b/twittperator.js @@ -1177,7 +1177,7 @@ if (msg.text) { history.unshift(msg); if (history.length > 1000) - history = history.slice(0, 1000); + __context__.Tweets = history = history.slice(0, 1000); } } @@ -1371,6 +1371,20 @@ function loadPlugins() { // {{{ } // }}} function setup() { // {{{ function commandCompelter(context, args) { + const SubCommands = [ + { + command: ["+", "fav"], + action: function (args) { + }, + completer: function (context, args) { + context.title = ["Name","Entry"]; + list = history.map(function(s) ("retweeted_status" in s) ? + ["@" + s.retweeted_status.user.screen_name, s] : + ["@" + s.user.screen_name, s]); + } + } + ]; + function statusObjectFilter(item) let (desc = item.description) (this.match(desc.user.screen_name) || this.match(desc.text)); @@ -1525,10 +1539,10 @@ function loadPlugins() { // {{{ let debugVars = __context__.__debugVars__; let history; - if (debugVars.history) { - history = debugVars.history; + if (__context__.Tweets) { + history = __context__.Tweets; } else { - history = debugVars.history = accessor.get("history", []); + history = __context__.Tweets = accessor.get("history", []); liberator.registerObserver('exit', function () accessor.set("history", history)); } -- cgit v1.2.3