fix: align sidebar search matching

This commit is contained in:
t8y2
2026-05-26 11:57:12 +08:00
parent f895bb4de5
commit 7bdacc52ba
2 changed files with 14 additions and 0 deletions
+3
View File
@@ -31,6 +31,9 @@ function matchesSubsequence(text: string, query: string): boolean {
let j = 0;
for (let i = 0; i < text.length && j < query.length; i++) {
if (isWordBoundary(text, i) && i > 0) {
j = 0;
}
if (text[i] === query[j]) j++;
}
return j === query.length;