From f9eea554cc2f13d27de9f94441bb04a5a6950a8e Mon Sep 17 00:00:00 2001 From: Mario Date: Tue, 2 Dec 2025 14:17:35 +0100 Subject: [PATCH] Fix additional folder under windows bug --- src/langs.ts | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/langs.ts b/src/langs.ts index 8937cf4..e3e5291 100644 --- a/src/langs.ts +++ b/src/langs.ts @@ -22,7 +22,9 @@ export function createLink(editor: vscode.TextEditor, text: string): string { // if not an absolute path, prepend current directory if (!directory.startsWith("/")) { // get path to current file - const fsPath = editor.document.uri.fsPath; + let fsPath = editor.document.uri.fsPath; + // To ensure next line works properly (windows problem) + if (fsPath.includes("\\")) fsPath = editor.document.uri.path; // get directory of said file const fileDirname = fsPath.slice(0, fsPath.lastIndexOf("/")); // prepend directory to setting