Skip to content

Commit 7b8bbc9

Browse files
authored
Fix incorrect check (#281)
!== 0 would always be true now. Let's change it to check if the number of rules has changed, and only update if they are different
1 parent 75d7d2c commit 7b8bbc9

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/decorator.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -59,7 +59,7 @@ export function injectCustomTextmateTokens(rules: ValueEqualsSet<TextMateRule>)
5959
newRules.add(new TextMateRule(rule.scope, rule.settings));
6060
}
6161

62-
if (newRules.size !== 0) {
62+
if (newRules.size !== currentRules.length) {
6363
tokenColorCustomizations.textMateRules = newRules.toArray();
6464
tokensConfig.update("tokenColorCustomizations", tokenColorCustomizations, ConfigurationTarget.Workspace).then(
6565
() => {

0 commit comments

Comments
 (0)