diff --git a/plugins/c9.ide.ace.keymaps/cli.js b/plugins/c9.ide.ace.keymaps/cli.js index 15c6d9ff..a9d94568 100644 --- a/plugins/c9.ide.ace.keymaps/cli.js +++ b/plugins/c9.ide.ace.keymaps/cli.js @@ -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);