Skip to content

Commit 19cd94d

Browse files
nullcoderClaude
andcommitted
fix: resolve CodeMirror theme switching issue
Remove duplicate theme update effect that was interfering with proper theme switching. Now the editor correctly responds to manual theme changes while still supporting system theme detection. 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude <claude@ghostpaste.dev>
1 parent a908a97 commit 19cd94d

File tree

1 file changed

+0
-14
lines changed

1 file changed

+0
-14
lines changed

components/ui/code-editor.tsx

Lines changed: 0 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -296,20 +296,6 @@ export const CodeEditor = forwardRef<CodeEditorHandle, CodeEditorProps>(
296296
});
297297
}, [activeTheme, getThemeExtension]);
298298

299-
// Handle initial theme resolution when resolvedTheme becomes available
300-
useEffect(() => {
301-
if (!viewRef.current || !resolvedTheme) return;
302-
303-
// Only update if we're not using a theme override
304-
if (!themeOverride) {
305-
viewRef.current.dispatch({
306-
effects: themeCompartment.reconfigure(
307-
getThemeExtension(resolvedTheme)
308-
),
309-
});
310-
}
311-
}, [resolvedTheme, themeOverride, getThemeExtension]);
312-
313299
// Update read-only state
314300
useEffect(() => {
315301
if (!viewRef.current) return;

0 commit comments

Comments
 (0)