From f716a73b5944996c24e005ec165e7bbd46b93bdc Mon Sep 17 00:00:00 2001 From: Max Brunsfeld Date: Wed, 22 Aug 2018 10:30:40 -0700 Subject: [PATCH] Allow replacing editor's grammar with a grammar with the same scope name --- src/grammar-registry.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/grammar-registry.js b/src/grammar-registry.js index d82f14cb1..0c79d5b1e 100644 --- a/src/grammar-registry.js +++ b/src/grammar-registry.js @@ -134,7 +134,7 @@ class GrammarRegistry { } this.grammarScoresByBuffer.set(buffer, null) - if (grammar.scopeName !== buffer.getLanguageMode().getLanguageId()) { + if (grammar !== buffer.getLanguageMode().grammar) { buffer.setLanguageMode(this.languageModeForGrammarAndBuffer(grammar, buffer)) } @@ -161,7 +161,7 @@ class GrammarRegistry { ) this.languageOverridesByBufferId.delete(buffer.id) this.grammarScoresByBuffer.set(buffer, result.score) - if (result.grammar.scopeName !== buffer.getLanguageMode().getLanguageId()) { + if (result.grammar !== buffer.getLanguageMode().grammar) { buffer.setLanguageMode(this.languageModeForGrammarAndBuffer(result.grammar, buffer)) } }