Skip to content

Commit ad09697

Browse files
committed
fix
1 parent 2597614 commit ad09697

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

util.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -31,7 +31,7 @@ export const findMatchingPos = (
3131
let l = scopes;
3232
let i = start + direction;
3333

34-
while (l > 0) {
34+
while (l > 0 && i >= 0 && i < str.length) {
3535
const c = str[i];
3636
i += direction;
3737
if (c === pair[0]) l++;

0 commit comments

Comments
 (0)