mirror of
https://github.com/atom/atom.git
synced 2026-04-06 03:02:13 -04:00
Emit a grammar-changed event from edit session
This event is now listened for from the editor and re-emitted under the editor namespace. This removes the need to monitor the syntax's grammars-loaded event from both places and also mirrors the behavior of the path-changed event.
This commit is contained in:
@@ -841,6 +841,7 @@ class EditSession
|
||||
if @languageMode.reloadGrammar()
|
||||
@unfoldAll()
|
||||
@displayBuffer.tokenizedBuffer.resetScreenLines()
|
||||
@trigger 'grammar-changed'
|
||||
true
|
||||
|
||||
getDebugSnapshot: ->
|
||||
|
||||
@@ -395,8 +395,6 @@ class Editor extends View
|
||||
e.pageX = @renderedLines.offset().left
|
||||
onMouseDown(e)
|
||||
|
||||
@subscribe syntax, 'grammars-loaded', => @reloadGrammar()
|
||||
|
||||
@scrollView.on 'scroll', =>
|
||||
if @scrollView.scrollLeft() == 0
|
||||
@gutter.removeClass('drop-shadow')
|
||||
@@ -456,6 +454,9 @@ class Editor extends View
|
||||
@reloadGrammar()
|
||||
@trigger 'editor:path-changed'
|
||||
|
||||
@activeEditSession.on "grammar-changed.editor", =>
|
||||
@trigger 'editor:grammar-changed'
|
||||
|
||||
@trigger 'editor:path-changed'
|
||||
@resetDisplay()
|
||||
|
||||
@@ -1150,7 +1151,6 @@ class Editor extends View
|
||||
if grammarChanged
|
||||
@clearRenderedLines()
|
||||
@updateDisplay()
|
||||
@trigger 'editor:grammar-changed'
|
||||
grammarChanged
|
||||
|
||||
bindToKeyedEvent: (key, event, callback) ->
|
||||
|
||||
Reference in New Issue
Block a user