Server: rename the scoped search's rune-length helper so it doesn't clash
Merging the reliability branch added another utf16Len; 66a12207 also
records the merge of worktree-agent-a588aaf81441341cd.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This commit is contained in:
@@ -165,7 +165,7 @@ func runeMatches(text, query []rune, caseSensitive bool) []runeMatch {
|
|||||||
units := 0 // UTF-16 units before text[i]
|
units := 0 // UTF-16 units before text[i]
|
||||||
for i := 0; i <= len(text)-len(query); {
|
for i := 0; i <= len(text)-len(query); {
|
||||||
if runesEqual(text[i:i+len(query)], query, caseSensitive) {
|
if runesEqual(text[i:i+len(query)], query, caseSensitive) {
|
||||||
length := utf16Len(text[i : i+len(query)])
|
length := utf16RunesLen(text[i : i+len(query)])
|
||||||
matches = append(matches, runeMatch{offset: units, length: length})
|
matches = append(matches, runeMatch{offset: units, length: length})
|
||||||
units += length
|
units += length
|
||||||
i += len(query)
|
i += len(query)
|
||||||
@@ -201,7 +201,7 @@ func foldEqual(a, b rune) bool {
|
|||||||
return false
|
return false
|
||||||
}
|
}
|
||||||
|
|
||||||
func utf16Len(runes []rune) int {
|
func utf16RunesLen(runes []rune) int {
|
||||||
n := 0
|
n := 0
|
||||||
for _, r := range runes {
|
for _, r := range runes {
|
||||||
n += utf16.RuneLen(r)
|
n += utf16.RuneLen(r)
|
||||||
|
|||||||
Reference in New Issue
Block a user