Fix synctex controls with new Ace

This commit is contained in:
James Allen 2014-07-10 14:36:04 +01:00
parent 1ce5062800
commit aaebb0902d
3 changed files with 9 additions and 3 deletions

View file

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

View file

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

View file

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