Propertly fill window with background color

Close #805
This commit is contained in:
Junegunn Choi 2017-01-16 12:06:54 +09:00
parent f96173cbe4
commit 8e2e63f9b9
No known key found for this signature in database
GPG Key ID: 254BC280FEF9C627
2 changed files with 9 additions and 0 deletions

View File

@ -558,6 +558,11 @@ func (t *Terminal) resizeWindows() {
width,
height, false)
}
if !t.tui.IsOptimized() && t.theme != nil && t.theme.HasBg() {
for i := 0; i < t.window.Height(); i++ {
t.window.MoveAndClear(i, 0)
}
}
}
func (t *Terminal) move(y int, x int, clear bool) {

View File

@ -175,6 +175,10 @@ type ColorTheme struct {
Border Color
}
func (t *ColorTheme) HasBg() bool {
return t.Bg != colDefault
}
type Event struct {
Type int
Char rune