diff options
author | Michael Muré <batolettre@gmail.com> | 2019-11-03 20:47:29 +0100 |
---|---|---|
committer | Michael Muré <batolettre@gmail.com> | 2019-11-03 20:47:29 +0100 |
commit | cb8236c9c22007eb622b7219c58d3342f1f53d50 (patch) | |
tree | e232e5362486065d9b28bb55b9791690efb50c08 /termui/label_select.go | |
parent | 163ea9c93306c387f84ff0b85c2d8fca4c01e449 (diff) | |
download | git-bug-cb8236c9c22007eb622b7219c58d3342f1f53d50.tar.gz |
termui: migrate to awesome-gocui instead of the old fork I had
Diffstat (limited to 'termui/label_select.go')
-rw-r--r-- | termui/label_select.go | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/termui/label_select.go b/termui/label_select.go index 39edbdb1..a05d9c8b 100644 --- a/termui/label_select.go +++ b/termui/label_select.go @@ -4,7 +4,7 @@ import ( "fmt" "strings" - "github.com/MichaelMure/gocui" + "github.com/awesome-gocui/gocui" "github.com/MichaelMure/git-bug/bug" "github.com/MichaelMure/git-bug/cache" @@ -106,9 +106,9 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { x0 := 1 y0 := 0 - ls.scroll - v, err := g.SetView(labelSelectView, x0, 0, x0+width, maxY-2) + v, err := g.SetView(labelSelectView, x0, 0, x0+width, maxY-2, 0) if err != nil { - if err != gocui.ErrUnknownView { + if !gocui.IsUnknownView(err) { return err } @@ -117,8 +117,8 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { for i, label := range ls.labels { viewname := fmt.Sprintf("view%d", i) - v, err := g.SetView(viewname, x0+2, y0, x0+width-2, y0+2) - if err != nil && err != gocui.ErrUnknownView { + v, err := g.SetView(viewname, x0+2, y0, x0+width-2, y0+2, 0) + if err != nil && !gocui.IsUnknownView(err) { return err } ls.childViews = append(ls.childViews, viewname) @@ -137,10 +137,10 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { y0 += 2 } - v, err = g.SetView(labelSelectInstructionsView, -1, maxY-2, maxX, maxY) + v, err = g.SetView(labelSelectInstructionsView, -1, maxY-2, maxX, maxY, 0) ls.childViews = append(ls.childViews, labelSelectInstructionsView) if err != nil { - if err != gocui.ErrUnknownView { + if !gocui.IsUnknownView(err) { return err } v.Frame = false @@ -159,7 +159,7 @@ func (ls *labelSelect) layout(g *gocui.Gui) error { func (ls *labelSelect) disable(g *gocui.Gui) error { for _, view := range ls.childViews { - if err := g.DeleteView(view); err != nil && err != gocui.ErrUnknownView { + if err := g.DeleteView(view); err != nil && !gocui.IsUnknownView(err) { return err } } |