diff options
author | Caleb Bassi <calebjbassi@gmail.com> | 2018-04-11 11:53:38 -0700 |
---|---|---|
committer | Caleb Bassi <calebjbassi@gmail.com> | 2018-04-11 12:02:28 -0700 |
commit | 1090d326e8c85a07b5ec35d363e4ebdf67f85a54 (patch) | |
tree | 03a77d6e2c456fe6e3137eee8c11d4fc39008cc2 | |
parent | b870d199ba687607f059e4aa8dc0553b26b6f888 (diff) |
Update termui to fix table bug
-rw-r--r-- | Gopkg.lock | 2 | ||||
-rw-r--r-- | vendor/github.com/cjbassi/termui/table.go | 6 | ||||
-rw-r--r-- | vendor/github.com/cjbassi/termui/utils.go | 7 | ||||
-rw-r--r-- | widgets/cpu.go | 2 | ||||
-rw-r--r-- | widgets/net.go | 2 |
5 files changed, 13 insertions, 6 deletions
@@ -17,7 +17,7 @@ branch = "master" name = "github.com/cjbassi/termui" packages = ["."] - revision = "b7a9b813b6a3bb09604fe10853cfd437291f20a1" + revision = "f1b2f22c3713217ceeb39b297418fabce7bb7e6e" [[projects]] branch = "master" diff --git a/vendor/github.com/cjbassi/termui/table.go b/vendor/github.com/cjbassi/termui/table.go index d86798c..79dd6f2 100644 --- a/vendor/github.com/cjbassi/termui/table.go +++ b/vendor/github.com/cjbassi/termui/table.go @@ -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() diff --git a/vendor/github.com/cjbassi/termui/utils.go b/vendor/github.com/cjbassi/termui/utils.go index 614828b..bfb0502 100644 --- a/vendor/github.com/cjbassi/termui/utils.go +++ b/vendor/github.com/cjbassi/termui/utils.go @@ -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 +} diff --git a/widgets/cpu.go b/widgets/cpu.go index b84af2c..0533218 100644 --- a/widgets/cpu.go +++ b/widgets/cpu.go @@ -12,7 +12,7 @@ import ( type CPU struct { *ui.LineGraph - Count int // number of CPUs + Count int // number of cores interval time.Duration } diff --git a/widgets/net.go b/widgets/net.go index 1155db3..c2e5698 100644 --- a/widgets/net.go +++ b/widgets/net.go @@ -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", |