Skip to content

Commit e3c3ead

Browse files
committed
Settings tweak
1 parent 85ba6a4 commit e3c3ead

File tree

1 file changed

+7
-4
lines changed

1 file changed

+7
-4
lines changed

src/lib/registerColorDecorator.ts

Lines changed: 7 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,12 @@ export function registerColorDecorator(
5151
workspace.getConfiguration('tailwindCSS', editor.document)
5252
.colorDecorators || 'inherit'
5353

54-
let enabled =
54+
let enabled: boolean =
5555
preference === 'inherit'
56-
? workspace.getConfiguration('editor').colorDecorators
56+
? Boolean(workspace.getConfiguration('editor').colorDecorators)
5757
: preference === 'on'
5858

59-
if (enabled !== true) {
59+
if (!enabled) {
6060
editor.setDecorations(colorDecorationType, [])
6161
return
6262
}
@@ -120,7 +120,10 @@ export function registerColorDecorator(
120120
)
121121

122122
workspace.onDidChangeConfiguration((e) => {
123-
if (e.affectsConfiguration('tailwindCSS.colorDecorators')) {
123+
if (
124+
e.affectsConfiguration('editor.colorDecorators') ||
125+
e.affectsConfiguration('tailwindCSS.colorDecorators')
126+
) {
124127
window.visibleTextEditors.forEach(updateDecorationsInEditor)
125128
}
126129
})

0 commit comments

Comments
 (0)