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
resetOpenStates()
onInternalResize()
}
]

View file

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

View file

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