From e3c3ead8eada53bbb3ce9079fb66fd3a9e923cd9 Mon Sep 17 00:00:00 2001 From: Brad Cornes Date: Fri, 14 Aug 2020 16:27:38 +0100 Subject: [PATCH] Settings tweak --- src/lib/registerColorDecorator.ts | 11 +++++++---- 1 file changed, 7 insertions(+), 4 deletions(-) diff --git a/src/lib/registerColorDecorator.ts b/src/lib/registerColorDecorator.ts index 5d3aae4..7ae0d7d 100644 --- a/src/lib/registerColorDecorator.ts +++ b/src/lib/registerColorDecorator.ts @@ -51,12 +51,12 @@ export function registerColorDecorator( 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 @@ export function registerColorDecorator( ) workspace.onDidChangeConfiguration((e) => { - if (e.affectsConfiguration('tailwindCSS.colorDecorators')) { + if ( + e.affectsConfiguration('editor.colorDecorators') || + e.affectsConfiguration('tailwindCSS.colorDecorators') + ) { window.visibleTextEditors.forEach(updateDecorationsInEditor) } })