mirror of
https://github.com/overleaf/overleaf.git
synced 2024-11-30 10:23:04 -05:00
Dispatch linting error event when changed
This commit is contained in:
parent
65b2c42fad
commit
c42b08fcff
1 changed files with 13 additions and 1 deletions
|
@ -35,7 +35,7 @@ define [
|
||||||
url = ace.config._moduleUrl(args...) + "?fingerprint=#{window.aceFingerprint}"
|
url = ace.config._moduleUrl(args...) + "?fingerprint=#{window.aceFingerprint}"
|
||||||
return url
|
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)
|
monkeyPatchSearch($rootScope, $compile)
|
||||||
|
|
||||||
return {
|
return {
|
||||||
|
@ -374,6 +374,18 @@ define [
|
||||||
if scope.eventsBridge?
|
if scope.eventsBridge?
|
||||||
session.on "changeScrollTop", onScroll
|
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 () ->
|
setTimeout () ->
|
||||||
# Let any listeners init themselves
|
# Let any listeners init themselves
|
||||||
onScroll(editor.renderer.getScrollTop())
|
onScroll(editor.renderer.getScrollTop())
|
||||||
|
|
Loading…
Reference in a new issue