Settings tweak

master
Brad Cornes 2020-08-14 16:27:38 +01:00
parent 85ba6a42cb
commit e3c3ead8ea
1 changed files with 7 additions and 4 deletions

View File

@ -51,12 +51,12 @@ export function registerColorDecorator(
workspace.getConfiguration('tailwindCSS', editor.document) workspace.getConfiguration('tailwindCSS', editor.document)
.colorDecorators || 'inherit' .colorDecorators || 'inherit'
let enabled = let enabled: boolean =
preference === 'inherit' preference === 'inherit'
? workspace.getConfiguration('editor').colorDecorators ? Boolean(workspace.getConfiguration('editor').colorDecorators)
: preference === 'on' : preference === 'on'
if (enabled !== true) { if (!enabled) {
editor.setDecorations(colorDecorationType, []) editor.setDecorations(colorDecorationType, [])
return return
} }
@ -120,7 +120,10 @@ export function registerColorDecorator(
) )
workspace.onDidChangeConfiguration((e) => { workspace.onDidChangeConfiguration((e) => {
if (e.affectsConfiguration('tailwindCSS.colorDecorators')) { if (
e.affectsConfiguration('editor.colorDecorators') ||
e.affectsConfiguration('tailwindCSS.colorDecorators')
) {
window.visibleTextEditors.forEach(updateDecorationsInEditor) window.visibleTextEditors.forEach(updateDecorationsInEditor)
} }
}) })