mirror of
https://github.com/overleaf/overleaf.git
synced 2025-03-22 02:04:31 +00:00
Fix display of annotations when switching files in ace editor
The annotations (error markers) were not preserved when switching between files. The setAnnotations method was being called before the document is ready -- when the document is attached to ace the content is deleted and reinserted, which caused the annotations to be removed. To fix the problem we set the annotations after attaching.
This commit is contained in:
parent
10cd5186c2
commit
2ed934120c
1 changed files with 3 additions and 2 deletions
|
@ -170,8 +170,6 @@ define [
|
|||
session = editor.getSession()
|
||||
session.setUseWrapMode(true)
|
||||
session.setMode("ace/mode/latex")
|
||||
session.setAnnotations scope.annotations
|
||||
|
||||
|
||||
updateCount = 0
|
||||
onChange = () ->
|
||||
|
@ -193,6 +191,9 @@ define [
|
|||
undoManager.nextUpdateIsRemote = true
|
||||
|
||||
sharejs_doc.attachToAce(editor)
|
||||
# need to set annotations after attaching because attaching
|
||||
# deletes and then inserts document content
|
||||
session.setAnnotations scope.annotations
|
||||
|
||||
editor.focus()
|
||||
|
||||
|
|
Loading…
Reference in a new issue