Fix double click md preview when source document is not showing

Fixes #47188
This commit is contained in:
Matt Bierner
2018-04-16 15:21:24 -07:00
parent bc6a2d52ac
commit 3a14fde91d

View File

@@ -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);
}
}