Fix remote cursors

This commit is contained in:
James Allen
2014-06-30 14:01:39 +01:00
parent 0f9f04803e
commit d3d18c384a
5 changed files with 10 additions and 7 deletions

View File

@@ -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?

View File

@@ -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}")

View File

@@ -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

View File

@@ -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

View File

@@ -69,6 +69,7 @@
background-position: bottom left;
}
.remote-cursor {
position: absolute;
border-left: 2px solid transparent;
.nubbin {
height: 5px;