From a6bcf57ecb43becd789cfbe4bc386038fa000564 Mon Sep 17 00:00:00 2001 From: Caleb Bassi Date: Thu, 12 Apr 2018 15:53:49 -0700 Subject: [PATCH] Update termui for bug fixes --- Gopkg.lock | 2 +- vendor/github.com/cjbassi/termui/table.go | 12 ++++-------- vendor/github.com/cjbassi/termui/utils.go | 7 ------- 3 files changed, 5 insertions(+), 16 deletions(-) diff --git a/Gopkg.lock b/Gopkg.lock index 4e588d5..2ee7a27 100644 --- a/Gopkg.lock +++ b/Gopkg.lock @@ -17,7 +17,7 @@ branch = "master" name = "github.com/cjbassi/termui" packages = ["."] - revision = "f1b2f22c3713217ceeb39b297418fabce7bb7e6e" + revision = "39b79d4cffc860780782f8ca6cca4bbb9d38bbf2" [[projects]] branch = "master" diff --git a/vendor/github.com/cjbassi/termui/table.go b/vendor/github.com/cjbassi/termui/table.go index 79dd6f2..1e962a6 100644 --- a/vendor/github.com/cjbassi/termui/table.go +++ b/vendor/github.com/cjbassi/termui/table.go @@ -57,20 +57,16 @@ func (self *Table) ColResize() { 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) - // } - self.ColResizer() // prints header - for i, width := range self.ColWidths { + for i, h := range self.Header { + width := self.ColWidths[i] if width == 0 { break } - r := MaxString(self.Header[i], self.X-6) - buf.SetString(self.CellXPos[i], 1, r, self.Fg|AttrBold, self.Bg) + h = MaxString(h, self.X-6) + buf.SetString(self.CellXPos[i], 1, h, self.Fg|AttrBold, self.Bg) } // prints each row diff --git a/vendor/github.com/cjbassi/termui/utils.go b/vendor/github.com/cjbassi/termui/utils.go index bfb0502..614828b 100644 --- a/vendor/github.com/cjbassi/termui/utils.go +++ b/vendor/github.com/cjbassi/termui/utils.go @@ -34,10 +34,3 @@ func Error(issue, diagnostics string) { fmt.Println() panic(1) } - -func Max(x, y int) int { - if x > y { - return x - } - return y -}