Settings tweak
parent
85ba6a42cb
commit
e3c3ead8ea
|
@ -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)
|
||||||
}
|
}
|
||||||
})
|
})
|
||||||
|
|
Loading…
Reference in New Issue