@@ -37,6 +37,9 @@ define [], () ->
onCursorChange: () =>
@emitCursorUpdateEvent()
+ onSyncToPdf: () =>
+ @$scope.$emit "cursor:#{@$scope.name}:syncToPdf"
+
storeFirstVisibleLine: () ->
if @doc_id?
docPosition = @localStorage("doc.position.#{@doc_id}") || {}
@@ -718,6 +718,8 @@ define [
.then (highlights) ->
$scope.pdf.highlights = highlights
+ ide.$scope.$on "cursor:editor:syncToPdf", $scope.syncToPdf
$scope.syncToCode = () ->
synctex
.syncToCode($scope.pdf.position, includeVisualOffset: true, fromPdfPosition: true)