mirror of
https://github.com/microsoft/vscode.git
synced 2026-04-17 15:24:40 +01:00
@@ -10,7 +10,7 @@ import { MarkdownContributionProvider } from '../markdownExtensions';
|
||||
import { Disposable } from '../util/dispose';
|
||||
import { isMarkdownFile } from '../util/file';
|
||||
import { MdLinkOpener } from '../util/openDocumentLink';
|
||||
import { WebviewResourceProvider } from '../util/resources';
|
||||
import { areUrisEqual, WebviewResourceProvider } from '../util/resources';
|
||||
import { urlToUri } from '../util/url';
|
||||
import { ImageInfo, MdDocumentRenderer } from './documentRenderer';
|
||||
import { MarkdownPreviewConfigurationManager } from './previewConfig';
|
||||
@@ -29,7 +29,7 @@ export class PreviewDocumentVersion {
|
||||
}
|
||||
|
||||
public equals(other: PreviewDocumentVersion): boolean {
|
||||
return this.resource.fsPath === other.resource.fsPath
|
||||
return areUrisEqual(this.resource, other.resource)
|
||||
&& this._version === other._version;
|
||||
}
|
||||
}
|
||||
@@ -204,7 +204,7 @@ class MarkdownPreview extends Disposable implements WebviewResourceProvider {
|
||||
|
||||
|
||||
public isPreviewOf(resource: vscode.Uri): boolean {
|
||||
return this._resource.fsPath === resource.fsPath;
|
||||
return areUrisEqual(this._resource, resource);
|
||||
}
|
||||
|
||||
public postMessage(msg: ToWebviewMessage.Type) {
|
||||
|
||||
@@ -11,3 +11,10 @@ export interface WebviewResourceProvider {
|
||||
readonly cspSource: string;
|
||||
}
|
||||
|
||||
export function areUrisEqual(uri1: vscode.Uri, uri2: vscode.Uri): boolean {
|
||||
if (uri1.scheme === 'file' && uri2.scheme === 'file') {
|
||||
return uri1.fsPath.toLowerCase() === uri2.fsPath.toLowerCase();
|
||||
}
|
||||
|
||||
return uri1.fsPath === uri2.fsPath;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user