diff options
author | drry | 2008-11-07 23:34:36 +0000 |
---|---|---|
committer | drry | 2008-11-07 23:34:36 +0000 |
commit | 3e8d354c1199cb42298c69eff977a4b068246827 (patch) | |
tree | 8d43425adf01f704ddb60c3a5cc892df4f74aef3 /memo.js | |
parent | 26e7a3b656e1f9853cde1f7010afa3c21ffeaae5 (diff) | |
download | vimperator-plugins-3e8d354c1199cb42298c69eff977a4b068246827.tar.bz2 |
* cosmetic changes.
git-svn-id: http://svn.coderepos.org/share/lang/javascript/vimperator-plugins/trunk@22978 d0d07461-0603-4401-acd4-de1884942a52
Diffstat (limited to 'memo.js')
-rw-r--r-- | memo.js | 17 |
1 files changed, 9 insertions, 8 deletions
@@ -1,3 +1,4 @@ +// ==VimperatorPlugin== // @name memo // @description to write a memo // @description-ja メモを書く @@ -9,13 +10,13 @@ // ==/VimperatorPlugin== // // Usage: -// :memo +// :memo // show the memo that was written. // :memo fooooobar! // write "fooooobar!" to the specified memo file. // // Usage-ja: -// :memo +// :memo // 書かれたメモを表示する // :memo fooooobar! // "fooooobar!" と、メモに書く @@ -27,18 +28,18 @@ (function () { let localfilepath = liberator.globalVariables.memo_filepath || io.expandPath('~/.vimpmemo'); - let charset = 'UTF-8' + let charset = 'UTF-8'; //ネタ的 let lz = function(s,n)(s+'').replace(new RegExp('^.{0,'+(n-1)+'}$'),function(s)lz('0'+s,n)); function dateTime () { with (new Date()) - return lz(getYear() + 1900, 4) + '/' + - lz(getMonth(), 2) + '/' + - lz(getDate(), 2) + ' ' + + return lz(getFullYear(), 4) + '/' + + lz(getMonth() + 1, 2) + '/' + + lz(getDate(), 2) + ' ' + lz(getHours(), 2) + ':' + - lz(getMinutes(), 2) ; + lz(getMinutes(), 2); } function filepath () { @@ -53,7 +54,7 @@ let conv = Cc['@mozilla.org/intl/converter-output-stream;1']. createInstance(Ci.nsIConverterOutputStream); out.init(filepath(), 0x02 | 0x10 | 0x08, 0664, 0); - conv.init(out, charset, line.length, + conv.init(out, charset, line.length, Components.interfaces.nsIConverterInputStream.DEFAULT_REPLACEMENT_CHARACTER); conv.writeString(line); conv.close(); |