diff options
Diffstat (limited to 'termui/show_bug.go')
-rw-r--r-- | termui/show_bug.go | 15 |
1 files changed, 8 insertions, 7 deletions
diff --git a/termui/show_bug.go b/termui/show_bug.go index 0710fa34..528d1fa5 100644 --- a/termui/show_bug.go +++ b/termui/show_bug.go @@ -2,10 +2,11 @@ package termui import ( "bytes" + "errors" "fmt" "strings" - "github.com/MichaelMure/go-term-text" + text "github.com/MichaelMure/go-term-text" "github.com/awesome-gocui/gocui" "github.com/MichaelMure/git-bug/bug" @@ -61,7 +62,7 @@ func (sb *showBug) layout(g *gocui.Gui) error { v, err := g.SetView(showBugView, 0, 0, maxX*2/3, maxY-2, 0) if err != nil { - if !gocui.IsUnknownView(err) { + if !errors.Is(err, gocui.ErrUnknownView) { return err } @@ -78,7 +79,7 @@ func (sb *showBug) layout(g *gocui.Gui) error { v, err = g.SetView(showBugSidebarView, maxX*2/3+1, 0, maxX-1, maxY-2, 0) if err != nil { - if !gocui.IsUnknownView(err) { + if !errors.Is(err, gocui.ErrUnknownView) { return err } @@ -95,7 +96,7 @@ func (sb *showBug) layout(g *gocui.Gui) error { v, err = g.SetView(showBugInstructionView, -1, maxY-2, maxX, maxY, 0) if err != nil { - if !gocui.IsUnknownView(err) { + if !errors.Is(err, gocui.ErrUnknownView) { return err } @@ -199,7 +200,7 @@ func (sb *showBug) keybindings(g *gocui.Gui) error { func (sb *showBug) disable(g *gocui.Gui) error { for _, view := range sb.childViews { - if err := g.DeleteView(view); err != nil && !gocui.IsUnknownView(err) { + if err := g.DeleteView(view); err != nil && !errors.Is(err, gocui.ErrUnknownView) { return err } } @@ -384,7 +385,7 @@ func emptyMessagePlaceholder() string { func (sb *showBug) createOpView(g *gocui.Gui, name string, x0 int, y0 int, maxX int, height int, selectable bool) (*gocui.View, error) { v, err := g.SetView(name, x0, y0, maxX, y0+height+1, 0) - if err != nil && !gocui.IsUnknownView(err) { + if err != nil && !errors.Is(err, gocui.ErrUnknownView) { return nil, err } @@ -404,7 +405,7 @@ func (sb *showBug) createOpView(g *gocui.Gui, name string, x0 int, y0 int, maxX func (sb *showBug) createSideView(g *gocui.Gui, name string, x0 int, y0 int, maxX int, height int) (*gocui.View, error) { v, err := g.SetView(name, x0, y0, maxX, y0+height+1, 0) - if err != nil && !gocui.IsUnknownView(err) { + if err != nil && !errors.Is(err, gocui.ErrUnknownView) { return nil, err } |