mirror of
https://github.com/atom/atom.git
synced 2026-02-16 09:35:54 -05:00
Make TextEditorRegistry.setGrammarOverride take a scope name
Also, clear the stored grammar score for that editor when setting an override.
This commit is contained in:
@@ -132,9 +132,14 @@ export default class TextEditorRegistry {
|
||||
}))
|
||||
}
|
||||
|
||||
setGrammarOverride (editor, grammar) {
|
||||
this.editorGrammarOverrides[editor.id] = grammar.scopeName
|
||||
editor.setGrammar(grammar)
|
||||
setGrammarOverride (editor, scopeName) {
|
||||
this.editorGrammarOverrides[editor.id] = scopeName
|
||||
this.editorGrammarScores.delete(editor)
|
||||
editor.setGrammar(this.grammarRegistry.grammarForScopeName(scopeName))
|
||||
}
|
||||
|
||||
getGrammarOverride (editor) {
|
||||
return this.editorGrammarOverrides[editor.id]
|
||||
}
|
||||
|
||||
clearGrammarOverride (editor) {
|
||||
|
||||
Reference in New Issue
Block a user