lf icon indicating copy to clipboard operation
lf copied to clipboard

simplify code

Open horriblename opened this issue 3 years ago • 0 comments

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.

horriblename avatar May 25 '22 10:05 horriblename