Use the document that contains the md link as the resource for getting config, not the target document

This commit is contained in:
Matt Bierner
2019-09-10 16:30:49 -07:00
parent 28c5988f47
commit 2fe62e7dfe
3 changed files with 22 additions and 15 deletions

View File

@@ -38,7 +38,7 @@ function parseLink(
}
return {
uri: OpenDocumentLinkCommand.createCommandUri(resourcePath, tempUri.fragment),
uri: OpenDocumentLinkCommand.createCommandUri(document.uri, resourcePath, tempUri.fragment),
tooltip: localize('documentLink.tooltip', 'Follow link')
};
}
@@ -183,4 +183,4 @@ export default class LinkProvider implements vscode.DocumentLinkProvider {
}
return out;
}
}
}

View File

@@ -540,7 +540,7 @@ export class MarkdownPreview extends Disposable {
}
}
vscode.commands.executeCommand('_markdown.openDocumentLink', { path, fragment });
vscode.commands.executeCommand('_markdown.openDocumentLink', { path, fragment, fromResource: this.resource });
}
private async onCacheImageSizes(imageInfo: { id: string, width: number, height: number }[]) {