MCPcopy Index your code
hub / github.com/docker/docker-agent / SetContent

Method SetContent

pkg/tui/components/scrollview/scrollview.go:125–132  ·  view source on GitHub ↗

SetContent provides the full content buffer and total height. totalHeight may be >= len(lines) for virtual blank lines (e.g. bottomSlack). The lines slice must not be mutated in place after being passed here; callers rebuild a fresh slice when content changes.

(lines []string, totalHeight int)

Source from the content-addressed store, hash-verified

123// The lines slice must not be mutated in place after being passed here;
124// callers rebuild a fresh slice when content changes.
125func (m *Model) SetContent(lines []string, totalHeight int) {
126 if len(lines) != len(m.lines) || (len(lines) > 0 && &lines[0] != &m.lines[0]) {
127 m.lineWidths = nil
128 }
129 m.lines = lines
130 m.totalHeight = max(totalHeight, len(lines))
131 m.sb.SetDimensions(m.height, m.totalHeight)
132}
133
134// lineWidth returns the display width of content line i, memoized across frames.
135func (m *Model) lineWidth(i int) int {

Callers 15

renderFromCacheMethod · 0.80
ViewMethod · 0.80
filterSessionsMethod · 0.80
ViewMethod · 0.80
applyScrollingMethod · 0.80
ViewMethod · 0.80
ViewMethod · 0.80

Calls 1

SetDimensionsMethod · 0.45