aboutsummaryrefslogtreecommitdiffstats
path: root/twittperator.js
diff options
context:
space:
mode:
authoranekos2010-07-31 21:11:48 +0000
committeranekos2010-07-31 21:11:48 +0000
commite99b09d26879df9339db850c9238a42d68688ae4 (patch)
tree30bfe2d1f760a354028228a9405197b7f9ca63db /twittperator.js
parent15c24b264c49cd426a4e1bf52f6c46f07ba6b65d (diff)
downloadvimperator-plugins-e99b09d26879df9339db850c9238a42d68688ae4.tar.bz2
履歴サイズ修正時に残念な事になるのを修正
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@38110 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'twittperator.js')
-rwxr-xr-xtwittperator.js22
1 files 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));
}