mirror of
https://github.com/Microsoft/vscode
synced 2024-08-27 13:00:58 +00:00
parent
78f6c8cdd3
commit
54543cf5bf
|
@ -57,12 +57,12 @@ function doAfterImagesLoaded(cb: () => void) {
|
|||
}
|
||||
|
||||
onceDocumentLoaded(() => {
|
||||
const scrollProgress = state.scrollProgress;
|
||||
const scrollTo = !isNaN(state.line) ? state.line : state.scrollProgress;
|
||||
|
||||
if (typeof scrollProgress === 'number' && !settings.settings.fragment) {
|
||||
if (typeof scrollTo === 'number' && !settings.settings.fragment) {
|
||||
doAfterImagesLoaded(() => {
|
||||
scrollDisabledCount += 1;
|
||||
window.scrollTo(0, scrollProgress * document.body.clientHeight);
|
||||
window.scrollTo(0, scrollTo * document.body.clientHeight);
|
||||
});
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -755,6 +755,8 @@ export class DynamicMarkdownPreview extends Disposable implements IManagedMarkdo
|
|||
default:
|
||||
return;
|
||||
}
|
||||
} else if (!scrollLocation) {
|
||||
scrollLocation = new StartingScrollLine(0);
|
||||
}
|
||||
|
||||
this._preview.dispose();
|
||||
|
|
Loading…
Reference in a new issue