fix: Improve search term highlighting for words with punctuation

Co-authored-by: aider (gemini/gemini-2.5-pro) <aider@aider.chat>
This commit is contained in:
2026-02-13 10:48:20 -07:00
parent 5e5708de4e
commit a8c18f5dca
+1 -1
View File
@@ -47,7 +47,7 @@ export class TextProcessor {
strings.sort((a, b) => b.length - a.length) strings.sort((a, b) => b.length - a.length)
const joined = `(${strings const joined = `(${strings
.map(s => `\\b${escapeRegExp(s)}\\b|${escapeRegExp(s)}`) .map(s => `(?<!\\w)${escapeRegExp(s)}(?!\\w)`)
.join('|')})` .join('|')})`
return new RegExp(`${joined}`, 'gui') return new RegExp(`${joined}`, 'gui')