See other users' cursor position

This commit is contained in:
yflory
2018-12-04 17:18:42 +01:00
parent 60e7011adc
commit 1ba80a344b
10 changed files with 165 additions and 3 deletions

View File

@@ -9,6 +9,13 @@
@color: @colortheme_code-color
);
.cp-codemirror-cursor {
border-left: 2px solid red;
}
.cp-codemirror-selection {
background-color: rgba(255,0,0,0.3);
}
display: flex;
flex-flow: column;
max-height: 100%;

View File

@@ -301,6 +301,13 @@ define([
return content;
});
framework.onCursorUpdate(CodeMirror.setRemoteCursor);
framework.setCursorGetter(CodeMirror.getCursor);
editor.on('cursorActivity', function () {
if (editor._noCursorUpdate) { console.log('ok'); return; }
framework.updateCursor();
});
framework.onEditableChange(function () {
editor.setOption('readOnly', framework.isLocked() || framework.isReadOnly());
});