Egui::TextArea
Inherits Egui::Widget < Reference < Object
Constants
Above this size (bytes) the textarea goes virtual — see the file header. 512 KiB still full-wraps in ~100 ms once; past it, the open-time wrap and the per-edit re-wrap stop being pocket change.
Constructors
Class methods
Character offset of every line start (size = line count + 1: the last entry is the phantom line after a trailing newline). One byte scan: UTF-8 lead bytes count a character, 0x0A closes a line. O(bytesize), once per buffer identity.
Line index containing a character offset (binary search; rows are lines in virtual mode, so unlike the wrapped galley there is no boundary ambiguity — a line start belongs to its own line).
Build (or reuse) the window of laid-out rows around the viewport. The window spans one screen of margin rows on each side, so caret moves, page steps and smooth scrolling resolve against built rows; it rebuilds only when the viewport leaves it. Rows carry GLOBAL y (line index * line_h) — painting, culling and the scroll math all keep their absolute-offset meaning, and row_starts stays a slice of the global line starts so caret and selection indexes need no translation.