提交 1d876bbc 编写于 作者: M Matt Bierner

Fix a few potential file path casing issues for markdown preview

上级 5154ede1
......@@ -346,7 +346,7 @@ function showSource(mdUri: vscode.Uri) {
const docUri = vscode.Uri.parse(mdUri.query);
for (const editor of vscode.window.visibleTextEditors) {
if (editor.document.uri.toString() === docUri.toString()) {
if (editor.document.uri.fsPath === docUri.fsPath) {
return vscode.window.showTextDocument(editor.document, editor.viewColumn);
}
}
......
......@@ -28,7 +28,7 @@ export function isMarkdownFile(document: vscode.TextDocument) {
}
export function getMarkdownUri(uri: vscode.Uri) {
return uri.with({ scheme: 'markdown', path: uri.path + '.rendered', query: uri.toString() });
return uri.with({ scheme: 'markdown', path: uri.fsPath + '.rendered', query: uri.toString() });
}
export class MDDocumentContentProvider implements vscode.TextDocumentContentProvider {
......@@ -143,8 +143,8 @@ export class MDDocumentContentProvider implements vscode.TextDocumentContentProv
}
const initialData = {
previewUri: encodeURIComponent(uri.toString(true)),
source: encodeURIComponent(sourceUri.toString(true)),
previewUri: encodeURIComponent(uri.fsPath),
source: encodeURIComponent(sourceUri.fsPath),
line: initialLine,
scrollPreviewWithEditorSelection: !!markdownConfig.get('preview.scrollPreviewWithEditorSelection', true),
scrollEditorWithPreview: !!markdownConfig.get('preview.scrollEditorWithPreview', true),
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册