Skip to content

Commit

Permalink
Show color decorators in split editors (#888)
Browse files Browse the repository at this point in the history
* Show color decorators in all documents

* Update changelog
  • Loading branch information
thecrypticace authored Dec 19, 2023
1 parent 6de5173 commit 1ac2ec3
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 3 deletions.
1 change: 1 addition & 0 deletions packages/vscode-tailwindcss/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
12 changes: 9 additions & 3 deletions packages/vscode-tailwindcss/src/extension.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand All @@ -628,6 +633,7 @@ export async function activate(context: ExtensionContext) {
},
}))
)
})

return editableColors
},
Expand Down

0 comments on commit 1ac2ec3

Please sign in to comment.