Skip to content

Commit

Permalink
Fix a bug in word boundary check
Browse files Browse the repository at this point in the history
FIX: Fix a bug that caused whole-word search to incorrectly check for
word boundaries in some circumstances.

See https://discuss.codemirror.net/t/wholeword-search-fails-to-identify-certain-words/7119
  • Loading branch information
marijnh committed Sep 20, 2023
1 parent 14fb632 commit ab086a1
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion src/cursor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ export class SearchCursor implements Iterator<{from: number, to: number}>{
else
this.matches.push(1, pos)
}
if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferPos)) match = null
if (match && this.test && !this.test(match.from, match.to, this.buffer, this.bufferStart)) match = null
return match
}

Expand Down

0 comments on commit ab086a1

Please sign in to comment.