Default to not updating scroll position if no valid editor is found. Part of #25910

This commit is contained in:
Matt Bierner 2017-05-16 14:05:10 -07:00
parent 604248eebd
commit 087a2d2f24

View file

@ -206,7 +206,7 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv
return vscode.workspace.openTextDocument(sourceUri).then(document => {
this.config = MarkdownPreviewConfig.getCurrentConfig();
let initialLine = 0;
let initialLine: number | undefined = undefined;
const editor = vscode.window.activeTextEditor;
if (editor && editor.document.uri.fsPath === sourceUri.fsPath) {
initialLine = editor.selection.active.line;