mirror of
https://github.com/atom/atom.git
synced 2026-01-23 13:58:08 -05:00
Don't require that language modes have a getGrammar method
This commit is contained in:
@@ -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.
|
||||
|
||||
Reference in New Issue
Block a user