perf: prevent memory leak, data race and speed up ComputeCursorCol processing (#15)

- fix(wrapper): memory leak and data race
(https://github.com/versenilvis/IRIS/commit/4361febfc92858f34ff2a2b77df8298addbefa75)
- perf(overlay):speed up ComputeCursorCol processing
(https://github.com/versenilvis/IRIS/commit/918b067cfc9f71c4fa52e1573865ab3612acb7d8)
This commit is contained in:
VERSE
2026-07-02 16:53:42 +07:00
committed by GitHub
parent c7960aac46
commit 8f89c15e72
2 changed files with 45 additions and 37 deletions
+5
View File
@@ -117,6 +117,11 @@ func ComputeCursorCol(data []byte) int {
i++
continue
}
if b < 0x7f {
col++
i++
continue
}
r, size := utf8.DecodeRune(data[i:])
w := lipgloss.Width(string(r))
col += w