mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 21:01:33 +02:00
Fix remote cursors
This commit is contained in:
@@ -11,6 +11,12 @@ define [], () ->
|
||||
|
||||
@gotoStoredPosition()
|
||||
|
||||
@editor.on "changeSelection", () =>
|
||||
cursor = @editor.getCursorPosition()
|
||||
console.log "Updating cursor position", cursor
|
||||
@$scope.$apply () =>
|
||||
@$scope.cursorPosition = cursor
|
||||
|
||||
@$scope.$watch "gotoLine", (value) =>
|
||||
console.log "Going to line", value
|
||||
if value?
|
||||
|
||||
@@ -65,12 +65,6 @@ define [
|
||||
scope.$on event, () ->
|
||||
editor.resize()
|
||||
|
||||
editor.on "changeSelection", () ->
|
||||
cursor = editor.getCursorPosition()
|
||||
scope.$apply () ->
|
||||
if scope.cursorPosition?
|
||||
scope.cursorPosition = cursor
|
||||
|
||||
scope.$watch "theme", (value) ->
|
||||
editor.setTheme("ace/theme/#{value}")
|
||||
|
||||
|
||||
@@ -37,8 +37,9 @@ define [
|
||||
do (annotation) =>
|
||||
colorScheme = @_getColorScheme(annotation.hue)
|
||||
if annotation.cursor?
|
||||
console.log "DRAWING CURSOR", annotation
|
||||
@labels.push {
|
||||
text: annotation.text
|
||||
text: annotation.label
|
||||
range: new Range(
|
||||
annotation.cursor.row, annotation.cursor.column,
|
||||
annotation.cursor.row, annotation.cursor.column + 1
|
||||
|
||||
@@ -38,6 +38,7 @@ define [
|
||||
|
||||
UPDATE_INTERVAL: 500
|
||||
sendCursorPositionUpdate: () ->
|
||||
console.log "SENDING CURSOR POSITION UPDATE", @$scope.editor.cursorPosition
|
||||
if !@cursorUpdateTimeout?
|
||||
@cursorUpdateTimeout = setTimeout ()=>
|
||||
position = @$scope.editor.cursorPosition
|
||||
|
||||
@@ -69,6 +69,7 @@
|
||||
background-position: bottom left;
|
||||
}
|
||||
.remote-cursor {
|
||||
position: absolute;
|
||||
border-left: 2px solid transparent;
|
||||
.nubbin {
|
||||
height: 5px;
|
||||
|
||||
Reference in New Issue
Block a user