fix cross-section cursor navigation via keyboard

This commit is contained in:
tophf 2017-12-08 11:42:33 +03:00
parent 526fa46edf
commit 5faff66fab
2 changed files with 4 additions and 4 deletions

View File

@ -156,11 +156,11 @@ onDOMscriptReady('/codemirror.js').then(() => {
}
function nextEditor(cm) {
nextPrevEditor(cm, 1);
return nextPrevEditor(cm, 1);
}
function prevEditor(cm) {
nextPrevEditor(cm, -1);
return nextPrevEditor(cm, -1);
}
function nextPrevEditor(cm, direction) {

View File

@ -331,7 +331,7 @@ function nextPrevEditorOnKeydown(cm, event) {
}
event.preventDefault();
event.stopPropagation();
cm = CodeMirror.commands.prevEditor.call(cm);
cm = CodeMirror.commands.prevEditor(cm);
cm.setCursor(cm.doc.size - 1, key === 37 ? 1e20 : ch);
break;
case 39:
@ -347,7 +347,7 @@ function nextPrevEditorOnKeydown(cm, event) {
}
event.preventDefault();
event.stopPropagation();
cm = CodeMirror.commands.nextEditor.call(cm);
cm = CodeMirror.commands.nextEditor(cm);
cm.setCursor(0, 0);
break;
}