فهرست منبع

Fix synctex controls with new Ace

James Allen 12 سال پیش
والد
کامیت
aaebb0902d

+ 1 - 0
services/web/public/coffee/ide/directives/layout.coffee

@@ -96,5 +96,6 @@ define [
 							, 0
 
 					resetOpenStates()
+					onInternalResize()
 		}
 	]

+ 1 - 1
services/web/public/coffee/ide/editor/directives/aceEditor.coffee

@@ -91,7 +91,7 @@ define [
 						editor.setValue(text, -1)
 						session = editor.getSession()
 						session.setUseWrapMode(true)
-						session.setMode(new LatexMode())
+						session.setMode("ace/mode/latex")
 
 				scope.$watch "annotations", (annotations) ->
 					if annotations?

+ 7 - 2
services/web/public/coffee/ide/pdf/controllers/PdfController.coffee

@@ -229,13 +229,18 @@ define [
 				$scope.showControls = false
 			else
 				$scope.showControls = true
+
 			setTimeout () ->
 				$scope.$digest()
 			, 0
 
-		$scope.syncToPdf = () ->
+		@cursorPosition = null
+		ide.$scope.$on "cursor:editor:update", (event, @cursorPosition) =>
+
+		$scope.syncToPdf = () =>
+			return if !@cursorPosition?
 			synctex
-				.syncToPdf($scope.editor.cursorPosition)
+				.syncToPdf(@cursorPosition)
 				.then (highlights) ->
 					$scope.pdf.highlights = highlights