From 42140c52afb400dfc86215b88fc3204f5ecb7060 Mon Sep 17 00:00:00 2001 From: TC Date: Tue, 2 Jun 2026 10:26:05 +1000 Subject: [PATCH] :wheelchair: disable editing on splashscreen --- src/renderer/components/Editor/MarkdownEditor.tsx | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/renderer/components/Editor/MarkdownEditor.tsx b/src/renderer/components/Editor/MarkdownEditor.tsx index 2b3b82a..f61b5be 100644 --- a/src/renderer/components/Editor/MarkdownEditor.tsx +++ b/src/renderer/components/Editor/MarkdownEditor.tsx @@ -389,6 +389,7 @@ const annotationHistory = invertedEffects.of(tr => { }) const themeCompartment = new Compartment() +const editableCompartment = new Compartment() const markdownHighlight = HighlightStyle.define([ { tag: tags.heading, fontWeight: '700', color: 'var(--heading-color)' }, @@ -696,6 +697,7 @@ export function MarkdownEditor(): JSX.Element { annotationHistory, hrPlugin, themeCompartment.of(buildTheme(fontSize, theme === 'dark', focusMode)), + editableCompartment.of(EditorView.editable.of(false)), EditorView.lineWrapping, EditorView.updateListener.of((update) => { if (update.docChanged) { @@ -817,6 +819,7 @@ export function MarkdownEditor(): JSX.Element { annotations: Transaction.addToHistory.of(false) }) view.dispatch({ selection: { anchor: 0 } }) + view.dispatch({ effects: editableCompartment.reconfigure(EditorView.editable.of(!!activeFilePath)) }) // Restore saved scroll position, or go to top for new files const savedScroll = activeFilePath ? scrollPositions[activeFilePath] ?? 0 : 0 // Defer scroll restoration so CodeMirror finishes laying out the new content