Require full command for regexp command
This commit is contained in:
Pleshevskiy Dima 2017-12-03 18:41:36 +03:00 committed by GitHub
parent 82037f5da7
commit 43ebb42108

View File

@ -463,10 +463,10 @@ define(function(require, exports, module) {
cmd += last.value;
cmd = cmd.substr(1).trim();
var args = cmd.split(/\s+/);
cmd = args[0];
var firstCmd = args[0];
if (this.commands[cmd]) {
cmd = this.commands[cmd];
if (this.commands[firstCmd]) {
cmd = this.commands[firstCmd];
if (typeof cmd == "string")
return commands.exec(cmd, null, { argv: args });
else if (typeof cmd == "function")
@ -474,8 +474,8 @@ define(function(require, exports, module) {
else if (cmd.exec)
return cmd.exec(ed, { argv: args });
}
else if (commands.commands[cmd]) {
commands.exec(cmd, null, { argv: args });
else if (commands.commands[firstCmd]) {
commands.exec(firstCmd, null, { argv: args });
}
else if (/^\d+$/.test(cmd)) {
ed.gotoLine(cmd, 0, true);