defocus codemirror on Esc
This commit is contained in:
parent
60a5fb96be
commit
fb29638d00
|
@ -27,6 +27,7 @@
|
|||
keyMap: prefs.get('editor.keyMap'),
|
||||
extraKeys: Object.assign(CodeMirror.defaults.extraKeys || {}, {
|
||||
// independent of current keyMap
|
||||
'Esc': 'defocusEditor',
|
||||
'Alt-Enter': 'toggleStyle',
|
||||
'Alt-PageDown': 'nextEditor',
|
||||
'Alt-PageUp': 'prevEditor'
|
||||
|
|
|
@ -13,6 +13,7 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
save,
|
||||
toggleStyle,
|
||||
jumpToLine,
|
||||
defocusEditor,
|
||||
nextEditor, prevEditor,
|
||||
find, findNext, findPrev, replace, replaceAll,
|
||||
};
|
||||
|
@ -155,6 +156,10 @@ onDOMscriptReady('/codemirror.js').then(() => {
|
|||
return this.display.wrapper.parentNode;
|
||||
}
|
||||
|
||||
function defocusEditor(cm) {
|
||||
cm.display.input.blur();
|
||||
}
|
||||
|
||||
function nextEditor(cm) {
|
||||
return nextPrevEditor(cm, 1);
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue
Block a user