Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 6 additions & 0 deletions scripts/foldLayout.test.ts
Original file line number Diff line number Diff line change
Expand Up @@ -25,3 +25,9 @@ test('preview lifecycle starts and cleans up fold observation', () => {
assert.match(viewer, /observeFoldLayout\((?:markdownBody|body)\)/);
assert.match(viewer, /stopObservingFoldLayout\?\.\(\)/);
});

test('fold measurement pauses while the preview pane is hidden by edit mode', () => {
const viewer = readFileSync('src/lib/MarkdownViewer.svelte', 'utf8');

assert.match(viewer, /if \(!html \|\| !body \|\| \(isEditing && !isSplit\)\) return;/);
});
2 changes: 1 addition & 1 deletion src/lib/MarkdownViewer.svelte
Original file line number Diff line number Diff line change
Expand Up @@ -1016,7 +1016,7 @@ import { t } from './utils/i18n.js';
$effect(() => {
const html = sanitizedHtml;
const body = markdownBody;
if (!html || !body) return;
if (!html || !body || (isEditing && !isSplit)) return;

let cancelled = false;
tick().then(() => {
Expand Down
Loading