aboutsummaryrefslogtreecommitdiffstats
path: root/umihara.js
diff options
context:
space:
mode:
authoranekos2011-08-27 15:18:33 +0900
committeranekos2011-08-27 15:18:33 +0900
commit8bbc7c18aec5dcd4a91e451af91924dd3e566135 (patch)
treeb35b10247e736d2a5a6dcf071f910fa58f541c48 /umihara.js
parent67fc7568c2c4aabb4fefd2cfde2a3db064c2852c (diff)
downloadvimperator-plugins-8bbc7c18aec5dcd4a91e451af91924dd3e566135.tar.bz2
スタイル的な修正
Diffstat (limited to 'umihara.js')
-rw-r--r--umihara.js27
1 files changed, 16 insertions, 11 deletions
diff --git a/umihara.js b/umihara.js
index d5f950d..3b81918 100644
--- a/umihara.js
+++ b/umihara.js
@@ -1,5 +1,5 @@
/* {{{
-Copyright (c) 2008, anekos.
+Copyright (c) 2008-2011, anekos.
All rights reserved.
Redistribution and use in source and binary forms, with or without modification,
@@ -138,9 +138,10 @@ let PLUGIN_INFO =
liberator.echo(<pre>{msg}</pre>);
}
- let resultBuffer = '';
function kawase (value, clipboard, from, to) {
+ let resultBuffer = '';
+
[from, to] = [from || defaultSource, to || defaultTarget].map(function (it) it.toUpperCase());
if (from == '-')
from = defaultSource;
@@ -174,6 +175,9 @@ let PLUGIN_INFO =
let extra = {
argCount: '+',
bang: true,
+ options: [
+ [['-clipboard', '-c'], commands.OPTION_NOARG],
+ ],
completer: function (context, args) {
if (args.length == 1) {
// TODO - history
@@ -190,22 +194,23 @@ let PLUGIN_INFO =
['kawase'],
'Umihara Kawase Meow',
function (args) {
- let as = args;
- resultBuffer = '';
liberator.echo('<<Results>>\n')
- if (as.length == 0)
- as.push('1');
- while (as.length < 3)
- as.push('-');
- for (let i = 1, l = as.length - 1; i < l; i++) {
- let [value, from, to] = [as[0], as[i], l == i ? '-' : as[l]];
+
+ if (args.length == 0)
+ args.push('1');
+
+ while (args.length < 3)
+ args.push('-');
+
+ for (let i = 1, l = args.length - 1; i < l; i++) {
+ let [value, from, to] = [args[0], args[i], l == i ? '-' : args[l]];
liberator.log({
value: value,
from: from,
to: to
})
value = eval(value);
- kawase(value, args.bang, from, to);
+ kawase(value, args['-clipboard'] || args.bang, from, to);
}
},
extra,