mirror of
https://github.com/pulsar-edit/pulsar.git
synced 2024-08-16 14:40:23 +03:00
Add an event whenever a grammar is auto assigned that can be listened too
This commit is contained in:
parent
dff70516aa
commit
fddc8c4760
@ -193,6 +193,10 @@ module.exports = class GrammarRegistry {
|
||||
buffer.getPath(),
|
||||
getGrammarSelectionContent(buffer)
|
||||
);
|
||||
|
||||
// Emit an event whenever a grammar is auto-assigned
|
||||
this.emitter.emit("did-auto-assign-grammar", { grammar: result.grammar, buffer: buffer });
|
||||
|
||||
this.languageOverridesByBufferId.delete(buffer.id);
|
||||
this.grammarScoresByBuffer.set(buffer, result.score);
|
||||
if (result.grammar !== buffer.getLanguageMode().grammar) {
|
||||
|
Loading…
Reference in New Issue
Block a user