mirror of
https://github.com/atom/atom.git
synced 2026-01-24 22:38:20 -05:00
Wait a tick before sending the event.
This commit is contained in:
@@ -125,9 +125,14 @@ class TokenizedBuffer extends Model
|
||||
@disposables.add(@configSubscriptions)
|
||||
|
||||
@retokenizeLines()
|
||||
@emitter.emit 'did-use-grammar', grammar
|
||||
|
||||
@emitter.emit 'did-change-grammar', grammar
|
||||
|
||||
# Delay this to the next tick to ensure whoever created the buffer has the
|
||||
# change to listen for this event before we send it.
|
||||
process.nextTick =>
|
||||
@emitter.emit 'did-use-grammar', grammar
|
||||
|
||||
onDidUseGrammar: (callback) ->
|
||||
@emitter.on 'did-use-grammar', callback
|
||||
|
||||
|
||||
Reference in New Issue
Block a user