From 7bbdab340c9f69468439859c2b284fd221e0042f Mon Sep 17 00:00:00 2001 From: Victor Giers Date: Thu, 12 Mar 2026 15:58:51 +0100 Subject: [PATCH] Add editor theme extension based on theme in App.tsx --- src/App.tsx | 23 +++++++++++++++++++++++ 1 file changed, 23 insertions(+) diff --git a/src/App.tsx b/src/App.tsx index 44c4354..a683192 100644 --- a/src/App.tsx +++ b/src/App.tsx @@ -381,6 +381,29 @@ export default function App() { const trimmed = ollamaUrl.trim(); return (trimmed || DEFAULT_OLLAMA_URL).replace(/\/+$/, ""); }, [ollamaUrl]); + const editorThemeExtension = useMemo( + () => + EditorView.theme( + { + ".cm-content, .cm-scroller": { + caretColor: theme === "dark" ? "#f5f5f5" : "#1f1f1f" + }, + "&.cm-focused > .cm-scroller > .cm-cursorLayer .cm-cursor": { + borderLeftColor: theme === "dark" ? "#f5f5f5" : "#1f1f1f", + borderLeftWidth: "1.6px" + }, + ".cm-dropCursor": { + borderLeftColor: theme === "dark" ? "#f5f5f5" : "#1f1f1f", + borderLeftWidth: "1.6px" + }, + ".cm-fatCursor": { + background: theme === "dark" ? "rgba(245, 245, 245, 0.45)" : "rgba(31, 31, 31, 0.28)" + } + }, + { dark: theme === "dark" } + ), + [theme] + ); const folderById = useMemo(() => { const map = new Map();