From 3b7569542f01acd8cfa764719c31adac1c3152fd Mon Sep 17 00:00:00 2001 From: Robert Krahn Date: Wed, 12 Mar 2014 04:56:49 -0700 Subject: [PATCH] fixing emacs key handler when key code == -1 (this can happen with the change introduced in #5e2c5f4) --- lib/ace/keyboard/emacs.js | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/lib/ace/keyboard/emacs.js b/lib/ace/keyboard/emacs.js index 7e855959..f1adb9ef 100644 --- a/lib/ace/keyboard/emacs.js +++ b/lib/ace/keyboard/emacs.js @@ -219,6 +219,10 @@ exports.handler.bindKey = function(key, command) { }; exports.handler.handleKeyboard = function(data, hashId, key, keyCode) { + // if keyCode == -1 a non-printable key was pressed, such as just + // control. Handling those is currently not supported in this handler + if (keyCode === -1) return undefined; + var editor = data.editor; // insertstring data.count times if (hashId == -1) {