Skip to content

Commit 457acf8

Browse files
committed
Make scrollTo enough large to occur scroll events.
1 parent 732531a commit 457acf8

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

extensions/markdown-language-features/preview-src/scroll-sync.ts

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,7 @@ export function scrollToRevealSourceLine(line: number) {
143143
const progressInElement = line - Math.floor(line);
144144
scrollTo = previousTop + (rect.height * progressInElement);
145145
}
146+
scrollTo = Math.abs(scrollTo) < 1 ? Math.sign(scrollTo) : scrollTo;
146147
window.scroll(window.scrollX, Math.max(1, window.scrollY + scrollTo));
147148
}
148149

0 commit comments

Comments
 (0)