diff --git a/src/lib/MarkdownViewer.svelte b/src/lib/MarkdownViewer.svelte index b5a324f3..c843b714 100644 --- a/src/lib/MarkdownViewer.svelte +++ b/src/lib/MarkdownViewer.svelte @@ -361,6 +361,14 @@ import { createDocumentSession, type LoadMarkdownOptions } from './sessions/docu let isEditing = $derived(activeTab?.isEditing ?? false); let rawContent = $derived(activeTab?.rawContent ?? ''); let isSplit = $derived(activeTab?.isSplit ?? false); + /** + * Is there an editor on screen? The two flags are independent — split + * view is `isSplit` alone when entered from reading mode — so anything + * that hands the reader over to the editor has to ask both. The outline + * asked only `isEditing`, and a click on it in split view moved the + * preview but not the editor beside it (#744). + */ + let hasEditorPane = $derived(isEditing || isSplit); let frontMatterInfo = $derived(parseFrontMatter(rawContent)); // derived from tab manager @@ -429,7 +437,7 @@ import { createDocumentSession, type LoadMarkdownOptions } from './sessions/docu */ let editorToolbarHeight = $state(0); let paneTopChrome = $derived( - (isEditing || isSplit) && settings.showEditorToolbar ? editorToolbarHeight : 0, + hasEditorPane && settings.showEditorToolbar ? editorToolbarHeight : 0, ); let previewContentWidth = $derived(getPreviewContentWidth(settings.previewMaxWidth, settings.previewFullWidth)); let isOverhanging = $derived( @@ -3963,8 +3971,8 @@ import { createDocumentSession, type LoadMarkdownOptions } from './sessions/docu class:toc-resizing={isTocResizing} style="--toc-width: {settings.tocWidth}px; --pane-top-chrome: {paneTopChrome}px;"> -
- {#if isEditing || isSplit} +
+ {#if hasEditorPane} {#if settings.showEditorToolbar}
- {#if isSplit || isEditing} + {#if hasEditorPane}
{t('dragAndDrop.embed', settings.language)}