rebuildCache re-renders all entries using the current width. This is called when the terminal is resized. Syntax highlighting is NOT recomputed since it's width-independent and stored in highlightedCode.
()
| 110 | // This is called when the terminal is resized. Syntax highlighting is NOT |
| 111 | // recomputed since it's width-independent and stored in highlightedCode. |
| 112 | func (l *LogViewer) rebuildCache() { |
| 113 | l.totalLineCount = 0 |
| 114 | for i := range l.entries { |
| 115 | l.entries[i].cachedLines = l.renderEntry(l.entries[i]) |
| 116 | l.totalLineCount += len(l.entries[i].cachedLines) |
| 117 | } |
| 118 | } |
| 119 | |
| 120 | // ScrollUp scrolls up by one line. |
| 121 | func (l *LogViewer) ScrollUp() { |