https://git.jolheiser.com/tailwind-ctp-intellisense.git
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32
diff --git a/src/lib/registerColorDecorator.ts b/src/lib/registerColorDecorator.ts index 5d3aae4e22f64ac611094ac58453acc8fc9088d7..7ae0d7d0c48f8ed0da18dc0b04132699be9b474a 100644 --- a/src/lib/registerColorDecorator.ts +++ b/src/lib/registerColorDecorator.ts @@ -51,12 +51,12 @@ let preference = workspace.getConfiguration('tailwindCSS', editor.document) .colorDecorators || 'inherit' - let enabled = + let enabled: boolean = preference === 'inherit' - ? workspace.getConfiguration('editor').colorDecorators + ? Boolean(workspace.getConfiguration('editor').colorDecorators) : preference === 'on' - if (enabled !== true) { + if (!enabled) { editor.setDecorations(colorDecorationType, []) return } @@ -120,7 +120,10 @@ context.subscriptions ) workspace.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration('tailwindCSS.colorDecorators')) { + if ( + e.affectsConfiguration('editor.colorDecorators') || + e.affectsConfiguration('tailwindCSS.colorDecorators') + ) { window.visibleTextEditors.forEach(updateDecorationsInEditor) } })