mirror of
https://github.com/atom/atom.git
synced 2026-04-28 03:01:47 -04:00
Implement .setGrammar in terms of .setLanguageMode
This commit is contained in:
@@ -3561,7 +3561,8 @@ class TextEditor {
|
||||
//
|
||||
// * `grammar` {Grammar}
|
||||
setGrammar (grammar) {
|
||||
atom.grammars.assignLanguageMode(this.getBuffer(), grammar.name)
|
||||
const buffer = this.getBuffer()
|
||||
buffer.setLanguageMode(atom.grammars.languageModeForGrammarAndBuffer(grammar, buffer))
|
||||
}
|
||||
|
||||
// Experimental: Get a notification when async tokenization is completed.
|
||||
|
||||
Reference in New Issue
Block a user