Skip to content

Commit b79d93c

Browse files
committed
fix: path comparison on windows
fixes #30
1 parent a30d9d4 commit b79d93c

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/helpers.ts

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,11 @@
1-
import { Uri, Range, TextDocument } from "vscode";
1+
import { Range, type TextDocument, type Uri } from "vscode";
22

33
/**
44
* Computes the difference between two paths
55
*/
66
export const pathDiff = (base: Uri, path: Uri) => {
7-
const baseParts = base.path.split("/").filter(Boolean);
8-
const pathParts = path.path.split("/").filter(Boolean);
7+
const baseParts = base.fsPath.split(/[\/\\]/).filter(Boolean);
8+
const pathParts = path.fsPath.split(/[\/\\]/).filter(Boolean);
99
while (
1010
baseParts.length &&
1111
pathParts.length &&

0 commit comments

Comments
 (0)