Clean up renderer code

Remove code that is no longer relevant after the removal of ncurses
renderer. This commit also fixes background color issue on tcell-based
FullscreenRenderer (Windows).
This commit is contained in:
Junegunn Choi
2017-09-09 13:50:07 +09:00
parent 7cfa6f0265
commit e1582b8323
5 changed files with 53 additions and 70 deletions

View File

@@ -623,10 +623,8 @@ func (t *Terminal) resizeWindows() {
width,
height, tui.BorderNone)
}
if !t.tui.IsOptimized() {
for i := 0; i < t.window.Height(); i++ {
t.window.MoveAndClear(i, 0)
}
for i := 0; i < t.window.Height(); i++ {
t.window.MoveAndClear(i, 0)
}
t.truncateQuery()
}
@@ -722,7 +720,7 @@ func (t *Terminal) printHeader() {
t.move(line, 2, true)
t.printHighlighted(Result{item: item},
tui.AttrRegular, tui.ColHeader, tui.ColDefault, false, false)
tui.AttrRegular, tui.ColHeader, tui.ColHeader, false, false)
}
}
@@ -775,8 +773,7 @@ func (t *Terminal) printItem(result Result, line int, i int, current bool) {
return
}
// Optimized renderer can simply erase to the end of the window
t.move(line, 0, t.tui.IsOptimized())
t.move(line, 0, false)
t.window.CPrint(tui.ColCursor, t.strong, label)
if current {
if selected {
@@ -793,11 +790,9 @@ func (t *Terminal) printItem(result Result, line int, i int, current bool) {
}
newLine.width = t.printHighlighted(result, 0, tui.ColNormal, tui.ColMatch, false, true)
}
if !t.tui.IsOptimized() {
fillSpaces := prevLine.width - newLine.width
if fillSpaces > 0 {
t.window.Print(strings.Repeat(" ", fillSpaces))
}
fillSpaces := prevLine.width - newLine.width
if fillSpaces > 0 {
t.window.Print(strings.Repeat(" ", fillSpaces))
}
t.prevLines[i] = newLine
}