Skip to content

Commit f38aa63

Browse files
Fix fuzzy match in Explorer tree Find on an ISFS folder in 1.94 (fix #1445) (#1446)
1 parent e2b75ab commit f38aa63

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/providers/FileSystemProvider/FileSearchProvider.ts

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,12 @@ export class FileSearchProvider implements vscode.FileSearchProvider {
1919
let counter = 0;
2020
let pattern = query.pattern.charAt(0) == "/" ? query.pattern.slice(1) : query.pattern;
2121

22-
// Drop a leading **/ from the glob pattern if it exists (added by Find widget of Explorer tree, which since 1.94 uses FileSearchProvider)
22+
// Drop a leading **/ from the glob pattern if it exists. This gets added by Find widget of Explorer tree (non-fuzzy mode), which since 1.94 uses FileSearchProvider
2323
if (pattern.startsWith("**/")) {
2424
pattern = pattern.slice(3);
25+
} else if (pattern.length) {
26+
// Do a fuzzy search
27+
pattern = "*" + pattern.split("").join("*") + "*";
2528
}
2629
const params = new URLSearchParams(options.folder.query);
2730
const csp = params.has("csp") && ["", "1"].includes(params.get("csp"));

0 commit comments

Comments
 (0)