diff options
-rw-r--r-- | pluginManager.js | 16 |
1 files changed, 14 insertions, 2 deletions
diff --git a/pluginManager.js b/pluginManager.js index a44d158..65e0a5e 100644 --- a/pluginManager.js +++ b/pluginManager.js @@ -540,12 +540,16 @@ HTMLStack.prototype = { // {{{ // -----------------------------------------------------{{{ commands.addUserCommand(['plugin[help]'], 'list Vimperator plugins', function(args){ - var xml; + var xml; if (args["-check"]) xml = liberator.plugins.pluginManager.checkVersion(args); else if (args["-update"]) xml = liberator.plugins.pluginManager.update(args); - else + else if (args["-source"]) { + if (args.length < 1) + return liberator.echoerr('Argument(plugin name) required'); + return liberator.plugins.pluginManager.source(args); + } else xml = liberator.plugins.pluginManager.list(args, args["-verbose"]); liberator.echo(xml, true); @@ -555,6 +559,7 @@ commands.addUserCommand(['plugin[help]'], 'list Vimperator plugins', [['-verbose', '-v'], commands.OPTION_NOARG], [['-check', '-c'], commands.OPTION_NOARG], [['-update', '-u'], commands.OPTION_NOARG], + [['-source', '-s'], commands.OPTION_NOARG], ], completer: function(context){ context.title = ['PluginName', '[Version]Description']; @@ -592,6 +597,13 @@ var public = { }); return xml; }, + source: function(names){ + // XXX 一度に開くようにするべき? (ref: editor.js L849) + this.getPlugins(names).forEach(function(plugin){ + editor.editFileExternally(plugin.path); + }); + return; + }, list: function(names, verbose){ let xml = <></> this.getPlugins(names).forEach(function(plugin){ |