diff options
author | Michael Muré <batolettre@gmail.com> | 2018-07-31 22:30:50 +0200 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2018-07-31 22:30:50 +0200 |
commit | 2f88c28c59ce0480e64dfba6d820dc6f7589a6cf (patch) | |
tree | 87edc4807303e299be08ebe1a8f2fed1de045de8 /termui/bug_table.go | |
parent | 6b012b1e485d369d82cb410a1652f53a752bf21c (diff) | |
download | git-bug-2f88c28c59ce0480e64dfba6d820dc6f7589a6cf.tar.gz |
termui: fix a pagination off by one
Diffstat (limited to 'termui/bug_table.go')
-rw-r--r-- | termui/bug_table.go | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/termui/bug_table.go b/termui/bug_table.go index 7f96df02..a6eb569d 100644 --- a/termui/bug_table.go +++ b/termui/bug_table.go @@ -45,7 +45,7 @@ func (bt *bugTable) layout(g *gocui.Gui) error { v.Clear() bt.renderHeader(v, maxX) - v, err = g.SetView(bugTableView, -1, 1, maxX, maxY-2) + v, err = g.SetView(bugTableView, -1, 1, maxX, maxY-3) if err != nil { if err != gocui.ErrUnknownView { @@ -59,7 +59,7 @@ func (bt *bugTable) layout(g *gocui.Gui) error { } _, viewHeight := v.Size() - err = bt.paginate(viewHeight - 1) + err = bt.paginate(viewHeight) if err != nil { return err } @@ -72,7 +72,7 @@ func (bt *bugTable) layout(g *gocui.Gui) error { v.Clear() bt.render(v, maxX) - v, err = g.SetView("footer", -1, maxY-3, maxX, maxY) + v, err = g.SetView("footer", -1, maxY-4, maxX, maxY) if err != nil { if err != gocui.ErrUnknownView { @@ -263,7 +263,7 @@ func (bt *bugTable) renderHeader(v *gocui.View, maxX int) { } func (bt *bugTable) renderFooter(v *gocui.View, maxX int) { - fmt.Fprintf(v, "Showing %d of %d bugs", len(bt.bugs), len(bt.allIds)) + fmt.Fprintf(v, " \nShowing %d of %d bugs", len(bt.bugs), len(bt.allIds)) } func (bt *bugTable) cursorDown(g *gocui.Gui, v *gocui.View) error { |