Creates space to print error and menu string
(lines int)
| 125 | |
| 126 | // Creates space to print error and menu string |
| 127 | func (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 | |
| 146 | func (lk *LogKeyboard) printNavigationMenu() { |
| 147 | offset := 1 |
no test coverage detected