Skip to content

Commit b22b4fa

Browse files
committed
fix: ensure color previews update on initial load
1 parent 4f99ad2 commit b22b4fa

File tree

1 file changed

+11
-0
lines changed
  • src/extensions/default/CSSColorPreview

1 file changed

+11
-0
lines changed

src/extensions/default/CSSColorPreview/main.js

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -128,6 +128,17 @@ define(function (require, exports, module) {
128128
CssColorPreview.showColorMarks();
129129
}
130130
});
131+
132+
// Handle the currently active editor at initialization
133+
const activeEditor = EditorManager.getActiveEditor();
134+
if (activeEditor) {
135+
const cm = activeEditor._codeMirror;
136+
if (cm) {
137+
cm.on("change", CssColorPreview.onChanged);
138+
}
139+
CssColorPreview.showColorMarks();
140+
}
141+
131142
},
132143

133144
initGutter: function (editor) {

0 commit comments

Comments
 (0)