Update termui for bug fixes

This commit is contained in:
Caleb Bassi 2018-04-12 15:53:49 -07:00
parent 1225515f3e
commit a6bcf57ecb
3 changed files with 5 additions and 16 deletions

2
Gopkg.lock generated
View File

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

View File

@ -57,20 +57,16 @@ func (self *Table) ColResize() {
func (self *Table) Buffer() *Buffer { func (self *Table) Buffer() *Buffer {
buf := self.Block.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() self.ColResizer()
// prints header // prints header
for i, width := range self.ColWidths { for i, h := range self.Header {
width := self.ColWidths[i]
if width == 0 { if width == 0 {
break break
} }
r := MaxString(self.Header[i], self.X-6) h = MaxString(h, self.X-6)
buf.SetString(self.CellXPos[i], 1, r, self.Fg|AttrBold, self.Bg) buf.SetString(self.CellXPos[i], 1, h, self.Fg|AttrBold, self.Bg)
} }
// prints each row // prints each row

View File

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