Clarifying comment

This commit is contained in:
sloumdrone 2019-05-31 22:34:59 -07:00
parent 5a82541dee
commit 43b9953c80
2 changed files with 12 additions and 6 deletions

View File

@ -39,7 +39,6 @@ func (s *Screen) AddMsgBar(row int, title, msg string, showTitle bool) {
// DrawAllWindows loops over every window in the Screen struct and
// draws it to screen in index order (smallest to largest)
func (s Screen) DrawAllWindows() {
// s.Clear()
for _, w := range s.Windows {
if w.Show {
w.DrawWindow()
@ -56,6 +55,15 @@ func (s Screen) Clear() {
}
}
// Clears message/error/command area
func (s *Screen) ClearCommandArea() {
MoveCursorTo(s.Height-1, 1)
Clear("line")
MoveCursorTo(s.Height, 1)
Clear("line")
MoveCursorTo(s.Height-1, 1)
}
// ReflashScreen checks for a screen resize and resizes windows if
// needed then redraws the screen. It takes a bool to decide whether
// to redraw the full screen or just the content. On a resize
@ -64,12 +72,9 @@ func (s *Screen) ReflashScreen(clearScreen bool) {
if clearScreen {
s.DrawAllWindows()
s.DrawMsgBars()
s.ClearCommandArea()
} else {
for _, w := range s.Windows {
if w.Show {
w.DrawWindow()
}
}
s.DrawAllWindows()
}
}

View File

@ -471,6 +471,7 @@ func handleResize() {
screen.DrawAllWindows()
screen.DrawMsgBars()
screen.ClearCommandArea()
}
}