diff --git a/packages/vscode-tailwindcss/CHANGELOG.md b/packages/vscode-tailwindcss/CHANGELOG.md index f4a3cf32..a0443452 100644 --- a/packages/vscode-tailwindcss/CHANGELOG.md +++ b/packages/vscode-tailwindcss/CHANGELOG.md @@ -3,6 +3,7 @@ ## 0.11.x (Pre-Release) - Enable Sort Selection on a remote host (#878) +- Show color decorators in split editors (#888) ## 0.10.2 diff --git a/packages/vscode-tailwindcss/src/extension.ts b/packages/vscode-tailwindcss/src/extension.ts index f3860271..e7121211 100755 --- a/packages/vscode-tailwindcss/src/extension.ts +++ b/packages/vscode-tailwindcss/src/extension.ts @@ -613,9 +613,14 @@ export async function activate(context: ExtensionContext) { }) } - Window.visibleTextEditors - .find((editor) => editor.document === document) - ?.setDecorations( + let editors = Window.visibleTextEditors.filter( + (editor) => editor.document === document + ) + + // Make sure we show document colors for all visible editors + // Not just the first one for a given document + editors.forEach((editor) => { + editor.setDecorations( colorDecorationType, nonEditableColors.map(({ range, color }) => ({ range, @@ -628,6 +633,7 @@ export async function activate(context: ExtensionContext) { }, })) ) + }) return editableColors },