mirror of
https://github.com/yu-i-i/overleaf-cep.git
synced 2026-05-31 21:01:33 +02:00
Dispatch linting error event when changed
This commit is contained in:
@@ -35,7 +35,7 @@ define [
|
||||
url = ace.config._moduleUrl(args...) + "?fingerprint=#{window.aceFingerprint}"
|
||||
return url
|
||||
|
||||
App.directive "aceEditor", ($timeout, $compile, $rootScope, event_tracking, localStorage, $cacheFactory, labels, graphics, preamble) ->
|
||||
App.directive "aceEditor", ($timeout, $compile, $rootScope, event_tracking, localStorage, $cacheFactory, labels, graphics, preamble, ide) ->
|
||||
monkeyPatchSearch($rootScope, $compile)
|
||||
|
||||
return {
|
||||
@@ -374,6 +374,18 @@ define [
|
||||
if scope.eventsBridge?
|
||||
session.on "changeScrollTop", onScroll
|
||||
|
||||
hasLintingError = null
|
||||
session.on('changeAnnotation', () ->
|
||||
hasErrors = session
|
||||
.getAnnotations()
|
||||
.filter((annotation) -> annotation.type == 'error')
|
||||
.length > 0
|
||||
|
||||
if (hasLintingError != hasErrors)
|
||||
ide.$scope.$broadcast('ide:lintingError', hasErrors)
|
||||
hasLintingError = hasErrors
|
||||
)
|
||||
|
||||
setTimeout () ->
|
||||
# Let any listeners init themselves
|
||||
onScroll(editor.renderer.getScrollTop())
|
||||
|
||||
Reference in New Issue
Block a user