A free and open source framework for building powerful, fast, and elegant 2D and 3D apps that run on macOS, Windows, Linux, iOS, Android, and the Web with a single pure Go codebase, allowing you to Code Once, Run Everywhere.
a new LayoutAllLines call is made every time a new text line is added, and with any markup changes. most of the lines do not change, so we could usefully cache the existing renders. almost implemented it but an effective impl requires tracking the line insertion and deletion for the renders and hashes, which we are not currently doing (only buffer is doing it).
pass an update bool flag to LayoutAllLines and call with true from RenderLayout which is where all of these updates originate.
Describe the feature
a new LayoutAllLines call is made every time a new text line is added, and with any markup changes. most of the lines do not change, so we could usefully cache the existing renders. almost implemented it but an effective impl requires tracking the line insertion and deletion for the renders and hashes, which we are not currently doing (only buffer is doing it).
pass an
update bool
flag to LayoutAllLines and call with true from RenderLayout which is where all of these updates originate.hash function returns
uint64
https://pkg.go.dev/hash/maphash@go1.22.3#example-packageRelevant code