lf
lf copied to clipboard
simplify code
Correct me if I'm wrong but the following code does the same as ui.screen.Clear() right?
func (ui *ui) draw(nav *nav) {
st := tcell.StyleDefault
wtot, htot := ui.screen.Size()
for i := 0; i < wtot; i++ {
for j := 0; j < htot; j++ {
ui.screen.SetContent(i, j, ' ', nil, st)
}
}
From the docs:
Clear erases the screen. The contents of any screen buffers will also be cleared. This has the logical effect of filling the screen with spaces, using the global default style.