diff --git a/resources/gorilla-repl-client/js/codemirrorVM.js b/resources/gorilla-repl-client/js/codemirrorVM.js index 9bffec03c..0fdf8de7f 100644 --- a/resources/gorilla-repl-client/js/codemirrorVM.js +++ b/resources/gorilla-repl-client/js/codemirrorVM.js @@ -97,8 +97,7 @@ ko.bindingHandlers.codemirror = { // but I can't seem to get that to work. CodeMirror.commands['doNothing'] = function () {}; // then patch the Mac default keymap to get rid of the emacsy binding, which interfere with our shortcuts - CodeMirror.keyMap['macDefault'].fallthrough = "basic"; - // and then create our custom map, which will fall through to the (patched) default. Shift+Enter and variants + //and then create our custom map, which will fall through to the (patched) default. Shift+Enter and variants // are stopped from doing anything. CodeMirror.keyMap["gorilla"] = { 'Shift-Enter': "doNothing", diff --git a/resources/gorilla-repl-client/js/main.js b/resources/gorilla-repl-client/js/main.js index fc9359559..b3b373d7a 100644 --- a/resources/gorilla-repl-client/js/main.js +++ b/resources/gorilla-repl-client/js/main.js @@ -213,6 +213,13 @@ var app = function () { self.saveDialog.show(fname); }); + $(document).on("keydown", function (event) { + if (event.which == 27) { + Mousetrap.enable(Mousetrap.stopCallback()); + self.flashStatusMessage("Gorilla keymap: " + Mousetrap.enabled, 2000); + } + }); + eventBus.on("app:reset-worksheet", function () { setBlankWorksheet(); });