diff --git a/lib/ace/keyboard/vim.js b/lib/ace/keyboard/vim.js index 0e358c86..5313e44c 100644 --- a/lib/ace/keyboard/vim.js +++ b/lib/ace/keyboard/vim.js @@ -88,7 +88,9 @@ exports.handler = { if (hashId == 1) key = "ctrl-" + key; - if (data.state == "start") { + if ((key == "esc" && hashId == 0) || key == "ctrl-[") { + return {command: coreCommands.stop}; + } else if (data.state == "start") { if (useragent.isMac && this.handleMacRepeat(data, hashId, key)) { hashId = -1; key = data.inputChar; @@ -109,10 +111,7 @@ exports.handler = { return {command: coreCommands.stop}; } } else { - if (key == "esc" || key == "ctrl-[") { - data.state = "start"; - return {command: coreCommands.stop}; - } else if (key == "ctrl-w") { + if (key == "ctrl-w") { return {command: "removewordleft"}; } }