|
|
|
@ -310,18 +310,24 @@ define([ |
|
|
|
}); |
|
|
|
|
|
|
|
framework.setContentGetter(function () { |
|
|
|
CodeMirror.removeCursors(); |
|
|
|
var content = CodeMirror.getContent(); |
|
|
|
content.highlightMode = CodeMirror.highlightMode; |
|
|
|
previewPane.draw(); |
|
|
|
return content; |
|
|
|
}); |
|
|
|
|
|
|
|
var cursorTo; |
|
|
|
var updateCursor = function () { |
|
|
|
if (cursorTo) { clearTimeout(cursorTo); } |
|
|
|
if (editor._noCursorUpdate) { return; } |
|
|
|
cursorTo = setTimeout(function () { |
|
|
|
framework.updateCursor(); |
|
|
|
}, 500); // 500ms to make sure it is sent after chainpad sync
|
|
|
|
}; |
|
|
|
framework.onCursorUpdate(CodeMirror.setRemoteCursor); |
|
|
|
framework.setCursorGetter(CodeMirror.getCursor); |
|
|
|
editor.on('cursorActivity', function () { |
|
|
|
if (editor._noCursorUpdate) { return; } |
|
|
|
framework.updateCursor(); |
|
|
|
}); |
|
|
|
editor.on('cursorActivity', updateCursor); |
|
|
|
|
|
|
|
framework.onEditableChange(function () { |
|
|
|
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly()); |
|
|
|
|