Something went wrong. Try again.
small gleam coding and persistent agent daemon with a detachable cli and a canvas ui forked from okami.mom/albedo
Something went wrong. Try again.
123456789101112131415161718192021222324252627282930package layout
import ( "sync"
uv "github.com/charmbracelet/ultraviolet" "github.com/charmbracelet/ultraviolet/internal/lru")
// globalCacheSize is chosen to comfortably hold one entry per row and column// of a typical terminal, with headroom to spare. A 171-column x 51-row// display yields 222 unique keys; doubling and rounding up gives 500.const globalCacheSize = 500
var ( globalCache = lru.New[cacheKey, cacheValue](globalCacheSize) globalCacheMu sync.Mutex)
type cacheKey struct { Area uv.Rectangle Direction Direction ConstraintsHash uint64 Padding Padding Spacing int Flex Flex}
type cacheValue struct{ Segments, Spacers Splitted }