diff options
author | anekos | 2011-08-27 15:18:33 +0900 |
---|---|---|
committer | anekos | 2011-08-27 15:18:33 +0900 |
commit | 8bbc7c18aec5dcd4a91e451af91924dd3e566135 (patch) | |
tree | b35b10247e736d2a5a6dcf071f910fa58f541c48 /umihara.js | |
parent | 67fc7568c2c4aabb4fefd2cfde2a3db064c2852c (diff) | |
download | vimperator-plugins-8bbc7c18aec5dcd4a91e451af91924dd3e566135.tar.bz2 |
スタイル的な修正
Diffstat (limited to 'umihara.js')
-rw-r--r-- | umihara.js | 27 |
1 files changed, 16 insertions, 11 deletions
@@ -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, |