diff --git a/extensions/markdown-language-features/src/features/preview.ts b/extensions/markdown-language-features/src/features/preview.ts index a6e37d28d82..a1c2cf45a13 100644 --- a/extensions/markdown-language-features/src/features/preview.ts +++ b/extensions/markdown-language-features/src/features/preview.ts @@ -239,10 +239,6 @@ export class MarkdownPreview { return this.editor.position; } - public isPreviewOf(resource: vscode.Uri): boolean { - return this._resource.fsPath === resource.fsPath; - } - public isWebviewOf(webview: vscode.WebviewPanel): boolean { return this.editor === webview; } @@ -276,6 +272,10 @@ export class MarkdownPreview { this.editor.webview.title = MarkdownPreview.getPreviewTitle(this._resource, this._locked); } + private isPreviewOf(resource: vscode.Uri): boolean { + return this._resource.fsPath === resource.fsPath; + } + private static getPreviewTitle(resource: vscode.Uri, locked: boolean): string { return locked ? localize('lockedPreviewTitle', '[Preview] {0}', path.basename(resource.fsPath)) @@ -377,6 +377,8 @@ export class MarkdownPreview { return; } } + + vscode.workspace.openTextDocument(this._resource).then(vscode.window.showTextDocument); } }