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:
@@ -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
|
||||
|
||||
Reference in New Issue
Block a user