Fix remote changes in codemirror hijacking cursor
This commit is contained in:
parent
a973f907e5
commit
768dc71803
@ -62,15 +62,16 @@ define([
|
|||||||
});
|
});
|
||||||
|
|
||||||
editor._noCursorUpdate = false;
|
editor._noCursorUpdate = false;
|
||||||
editor.state.focused = true;
|
editor.scrollTo(scroll.left, scroll.top);
|
||||||
|
|
||||||
|
if (!editor.state.focused) { return; }
|
||||||
|
|
||||||
if(selects[0] === selects[1]) {
|
if(selects[0] === selects[1]) {
|
||||||
editor.setCursor(posToCursor(selects[0], remoteDoc));
|
editor.setCursor(posToCursor(selects[0], remoteDoc));
|
||||||
}
|
}
|
||||||
else {
|
else {
|
||||||
editor.setSelection(posToCursor(selects[0], remoteDoc), posToCursor(selects[1], remoteDoc));
|
editor.setSelection(posToCursor(selects[0], remoteDoc), posToCursor(selects[1], remoteDoc));
|
||||||
}
|
}
|
||||||
|
|
||||||
editor.scrollTo(scroll.left, scroll.top);
|
|
||||||
};
|
};
|
||||||
|
|
||||||
module.getHeadingText = function (editor) {
|
module.getHeadingText = function (editor) {
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user