mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-22 01:29:04 +01:00
Fix double click md preview when source document is not showing
Fixes #47188
This commit is contained in:
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user