charmbracelet / bubbles

TUI components for Bubble Tea 🫧

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Optimize Textarea’s `wrap()`

meowgorithm opened this issue · comments

As discussed in charmbracelet/bubbletea#831 (comment), let's memoize Textarea's Wrap() function to improve performance.

Can we please get #427 merged as this provides immediate benefits to the performance of textarea.

I believe combing this with the replacing runewidth.StringWidth with uniseg.StringWidth should give us a giant bump in performance such that there will be far less complaints about performance with this component.

Agreed — we should generally switch to uniseg.StringWidth; should also happen in muesli/termenv upstream.

Fixed by #427