mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
In LanguageMode, unsubscribe from old grammar when switching grammars
This commit is contained in:
@@ -32,6 +32,7 @@ class LanguageMode
|
||||
|
||||
setGrammar: (grammar, score) ->
|
||||
return if grammar is @grammar
|
||||
@unsubscribe(@grammar) if @grammar
|
||||
@grammar = grammar
|
||||
@currentGrammarScore = score ? grammar.getScore(@buffer.getPath(), @buffer.getText())
|
||||
@subscribe @grammar, 'grammar-updated', => @trigger 'grammar-updated'
|
||||
|
||||
Reference in New Issue
Block a user