Skip to content

Commit 1ac2ec3

Browse files
Show color decorators in split editors (tailwindlabs#888)
* Show color decorators in all documents * Update changelog
1 parent 6de5173 commit 1ac2ec3

File tree

2 files changed

+10
-3
lines changed

2 files changed

+10
-3
lines changed

packages/vscode-tailwindcss/CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
## 0.11.x (Pre-Release)
44

55
- Enable Sort Selection on a remote host (#878)
6+
- Show color decorators in split editors (#888)
67

78
## 0.10.2
89

packages/vscode-tailwindcss/src/extension.ts

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -613,9 +613,14 @@ export async function activate(context: ExtensionContext) {
613613
})
614614
}
615615

616-
Window.visibleTextEditors
617-
.find((editor) => editor.document === document)
618-
?.setDecorations(
616+
let editors = Window.visibleTextEditors.filter(
617+
(editor) => editor.document === document
618+
)
619+
620+
// Make sure we show document colors for all visible editors
621+
// Not just the first one for a given document
622+
editors.forEach((editor) => {
623+
editor.setDecorations(
619624
colorDecorationType,
620625
nonEditableColors.map(({ range, color }) => ({
621626
range,
@@ -628,6 +633,7 @@ export async function activate(context: ExtensionContext) {
628633
},
629634
}))
630635
)
636+
})
631637

632638
return editableColors
633639
},

0 commit comments

Comments
 (0)