diff options
Diffstat (limited to 'js/codeq/editor.js')
-rw-r--r-- | js/codeq/editor.js | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/js/codeq/editor.js b/js/codeq/editor.js index 27296d5..2f8476c 100644 --- a/js/codeq/editor.js +++ b/js/codeq/editor.js @@ -1,4 +1,4 @@ -codeq.makeEditor = function (elt, options) { +codeq.makeEditor = function (elt, options, onEscape) { var statusBar = $(elt).siblings(".block-statusbar")[0], updateStatusBar = function (pos) { statusBar.innerHTML = 'line ' + (pos.line+1) + ', column ' + (pos.ch+1); @@ -8,6 +8,8 @@ codeq.makeEditor = function (elt, options) { lineNumbers: true, matchBrackets: true, extraKeys: { + // allow a custom function to escape the editor (there is no blur) + 'Esc': onEscape || CodeMirror.Pass, // replace tabs with spaces 'Tab': function (cm) { var spaces = Array(cm.getOption("indentUnit") + 1).join(" "); |