Explorar el Código

Fix remote cursors

James Allen hace 12 años
padre
commit
d3d18c384a

+ 6 - 0
services/web/public/coffee/app/ide/editor/cursor-position/CursorPositionManager.coffee

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

+ 0 - 6
services/web/public/coffee/app/ide/editor/directives/aceEditor.coffee

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

+ 2 - 1
services/web/public/coffee/app/ide/editor/highlights/HighlightsManager.coffee

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

+ 1 - 0
services/web/public/coffee/app/ide/online-users/OnlineUsersManager.coffee

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

+ 1 - 0
services/web/public/stylesheets/app/editor.less

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