Expand description
Row counting for the input TextArea.
ratatui_textarea::TextArea does not expose how many on-screen rows its content occupies, so
counting them requires the very wrapping algorithm the widget renders with. The functions in
this module are a simplified copy of wrap.rs from ratatui-textarea v0.9.2 (MIT), dropping
the line-number gutter and tab-stop width logic, and the actual range handling (we only need a
number of lines as the result).
Functionsยง
- display_
width ๐ - Total display width of the given text.
- split_
range_ ๐by_ grapheme_ width - Wraps the given byte range of a line at grapheme boundaries, accounting for wide characters.
- wrap_
word_ ๐chunks - Wraps the given line at word boundaries, falling back to grapheme splitting for words wider than the width when enabled.
- wrapped_
line_ ๐count - How many lines need to be rendered for the given
mode, at least 1.