mirror of
https://github.com/kovidgoyal/kitty
synced 2026-07-25 17:52:02 +02:00
Decrease allocs when wrapping
This commit is contained in:
@@ -122,6 +122,10 @@ func (self *WCWidthIterator) Parse(b []byte) (ans int) {
|
||||
return self.current_width
|
||||
}
|
||||
|
||||
func (self *WCWidthIterator) CurrentWidth() int {
|
||||
return self.current_width
|
||||
}
|
||||
|
||||
func Stringwidth(text string) int {
|
||||
w := CreateWCWidthIterator()
|
||||
return w.Parse(utils.UnsafeStringToBytes(text))
|
||||
|
||||
Reference in New Issue
Block a user