MCPcopy
hub / github.com/docker/compose / createBuffer

Method createBuffer

cmd/formatter/shortcut.go:127–144  ·  view source on GitHub ↗

Creates space to print error and menu string

(lines int)

Source from the content-addressed store, hash-verified

125
126// Creates space to print error and menu string
127func (lk *LogKeyboard) createBuffer(lines int) {
128 if lk.kError.shouldDisplay() {
129 extraLines := extraLines(lk.kError.error()) + 1
130 lines += extraLines
131 }
132
133 // get the string
134 infoMessage := lk.navigationMenu()
135 // calculate how many lines we need to display the menu info
136 // might be needed a line break
137 extraLines := extraLines(infoMessage) + 1
138 lines += extraLines
139
140 if lines > 0 {
141 allocateSpace(lines)
142 moveCursorUp(lines)
143 }
144}
145
146func (lk *LogKeyboard) printNavigationMenu() {
147 offset := 1

Callers 1

printNavigationMenuMethod · 0.95

Calls 6

navigationMenuMethod · 0.95
extraLinesFunction · 0.85
allocateSpaceFunction · 0.85
moveCursorUpFunction · 0.85
shouldDisplayMethod · 0.80
errorMethod · 0.80

Tested by

no test coverage detected