Make sure we use normalized path for compare

Fixes #50760

(the path should already have been normalized at this point so I don't think there is any user impact)
This commit is contained in:
Matt Bierner 2018-05-30 11:16:16 -07:00
parent a7a4c6cb6a
commit 2319e47db1

View file

@ -46,10 +46,10 @@ export class OpenDocumentLinkCommand implements Command {
}
private async tryOpen(path: string, args: OpenDocumentLinkArgs) {
if (vscode.window.activeTextEditor && isMarkdownFile(vscode.window.activeTextEditor.document) && vscode.window.activeTextEditor.document.uri.fsPath === path) {
const resource = vscode.Uri.file(path);
if (vscode.window.activeTextEditor && isMarkdownFile(vscode.window.activeTextEditor.document) && vscode.window.activeTextEditor.document.uri.fsPath === resource.fsPath) {
return this.tryRevealLine(vscode.window.activeTextEditor, args.fragment);
} else {
const resource = vscode.Uri.file(path);
return vscode.workspace.openTextDocument(resource)
.then(vscode.window.showTextDocument)
.then(editor => this.tryRevealLine(editor, args.fragment));