Update termui to fix table bug

This commit is contained in:
Caleb Bassi 2018-04-11 11:53:38 -07:00
parent b870d199ba
commit 1090d326e8
5 changed files with 13 additions and 6 deletions

2
Gopkg.lock generated
View File

@ -17,7 +17,7 @@
branch = "master"
name = "github.com/cjbassi/termui"
packages = ["."]
revision = "b7a9b813b6a3bb09604fe10853cfd437291f20a1"
revision = "f1b2f22c3713217ceeb39b297418fabce7bb7e6e"
[[projects]]
branch = "master"

View File

@ -58,9 +58,9 @@ func (self *Table) Buffer() *Buffer {
buf := self.Block.Buffer()
// removes gap at the bottom of the current view if there is one
if self.TopRow > len(self.Rows)-(self.Y-1) {
self.TopRow = len(self.Rows) - (self.Y - 1)
}
// if self.TopRow > len(self.Rows)-(self.Y-1) {
// self.TopRow = len(self.Rows) - (self.Y - 1)
// }
self.ColResizer()

View File

@ -34,3 +34,10 @@ func Error(issue, diagnostics string) {
fmt.Println()
panic(1)
}
func Max(x, y int) int {
if x > y {
return x
}
return y
}

View File

@ -12,7 +12,7 @@ import (
type CPU struct {
*ui.LineGraph
Count int // number of CPUs
Count int // number of cores
interval time.Duration
}

View File

@ -55,7 +55,7 @@ func (self *Net) update() {
self.Lines[0].Data = append(self.Lines[0].Data, int(recvRecent))
self.Lines[1].Data = append(self.Lines[1].Data, int(sentRecent))
if recvRecent < 0 || sentRecent < 0 {
if int(recvRecent) < 0 || int(sentRecent) < 0 {
utils.Error("net data",
fmt.Sprint(
"curRecvTotal: ", curRecvTotal, "\n",