Skip to content

Commit 054c8d5

Browse files
committed
perf(mdviewer): reduce content sync debounce for snappier typing
- viewer → CM: 300ms → 50ms (CONTENT_CHANGE_DEBOUNCE) - CM → viewer: 150ms → 50ms (DEBOUNCE_TO_IFRAME_MS)
1 parent ec348f8 commit 054c8d5

2 files changed

Lines changed: 2 additions & 2 deletions

File tree

src-mdviewer/src/components/editor.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1566,7 +1566,7 @@ export function convertToMarkdown(contentEl) {
15661566

15671567
// Debounced content change emitter for bridge
15681568
let contentChangeTimer = null;
1569-
const CONTENT_CHANGE_DEBOUNCE = 300;
1569+
const CONTENT_CHANGE_DEBOUNCE = 50;
15701570

15711571
/**
15721572
* Re-compute data-source-line attributes on top-level block elements

src/extensionsIntegrated/Phoenix-live-preview/MarkdownSync.js

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ define(function (require, exports, module) {
5555
let _cursorUndoStack = [];
5656
let _cursorRedoStack = [];
5757

58-
const DEBOUNCE_TO_IFRAME_MS = 150;
58+
const DEBOUNCE_TO_IFRAME_MS = 50;
5959
const SCROLL_SYNC_DEBOUNCE_MS = 16;
6060
const SELECTION_SYNC_DEBOUNCE_MS = 200;
6161

0 commit comments

Comments
 (0)