Don't require that language modes have a getGrammar method

This commit is contained in:
Max Brunsfeld
2017-11-03 11:48:15 -07:00
parent 140a783011
commit bfffde9a76

View File

@@ -3545,7 +3545,8 @@ class TextEditor {
// Essential: Get the current {Grammar} of this editor.
getGrammar () {
return this.buffer.getLanguageMode().getGrammar() || NullGrammar
const languageMode = this.buffer.getLanguageMode()
return languageMode.getGrammar && languageMode.getGrammar() || NullGrammar
}
// Essential: Set the current {Grammar} of this editor.