diff options
author | anekos | 2011-09-27 23:26:53 +0900 |
---|---|---|
committer | anekos | 2011-09-27 23:26:53 +0900 |
commit | c86c685fc48afbbfea1d44733f4355bfe0f795ec (patch) | |
tree | 8bfcc23c3af56cbc72033727b688bf0a8611fd30 /alias.js | |
parent | 69465b0e78c3748d76250f1b3e4285352d0274ef (diff) | |
download | vimperator-plugins-c86c685fc48afbbfea1d44733f4355bfe0f795ec.tar.bz2 |
新しいコマンド名が被る場合に対処(半端に
Diffstat (limited to 'alias.js')
-rw-r--r-- | alias.js | 10 |
1 files changed, 10 insertions, 0 deletions
@@ -113,6 +113,15 @@ let INFO = (function () { + // FIXME "vim[perator]" に対応してない + function removeOld (name) { + let cmd = commands.get(name); + if (!cmd) + return; + if (cmd.specs instanceof Array) + cmd.specs = cmd.specs.filter(function (it) it !== name); + } + commands.addUserCommand( ['alias'], 'Define the alias for a command.', @@ -123,6 +132,7 @@ let INFO = if (!cmd) return liberator.echoerr('Not found command with: ' + oldName); + removeOld(newName); cmd.specs.push(newName); // XXX 必要でない気もする。実際コマンドの検索には要らない。 Command.prototype.init.call(cmd, cmd.specs, cmd.description, cmd.action); |