Skip to content

Commit 5af7860

Browse files
SidebailSidebailalexdima
authored
Fix file relative path link (microsoft#181475)
* Fix for file link with relative path * Removed redundant comments * Simplify fix to accomodate Windows paths --------- Co-authored-by: Sidebail <[email protected]> Co-authored-by: Alexandru Dima <[email protected]>
1 parent abd11f0 commit 5af7860

File tree

1 file changed

+2
-2
lines changed
  • src/vs/editor/contrib/links/browser

1 file changed

+2
-2
lines changed

src/vs/editor/contrib/links/browser/links.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -237,9 +237,9 @@ export class LinkDetector extends Disposable implements IEditorContribution {
237237
const fsPath = resources.originalFSPath(parsedUri);
238238

239239
let relativePath: string | null = null;
240-
if (fsPath.startsWith('/./')) {
240+
if (fsPath.startsWith('/./') || fsPath.startsWith('\\.\\')) {
241241
relativePath = `.${fsPath.substr(1)}`;
242-
} else if (fsPath.startsWith('//./')) {
242+
} else if (fsPath.startsWith('//./') || fsPath.startsWith('\\\\.\\')) {
243243
relativePath = `.${fsPath.substr(2)}`;
244244
}
245245

0 commit comments

Comments
 (0)