diff options
author | Dawid Dziurla <dawidd0811@gmail.com> | 2018-08-29 14:24:04 +0200 |
---|---|---|
committer | Dawid Dziurla <dawidd0811@gmail.com> | 2018-09-03 17:52:05 +0200 |
commit | 8a01d11202eb9c3a037a0c9ab75c3e2afc64f375 (patch) | |
tree | dfbb451bc5e7b3b4a39d9ef90aeb7ca8f5e15172 /pkg | |
parent | 28a9594ef7f7dad70efa9470ed12e5d102f6c5df (diff) |
more error checks
Diffstat (limited to 'pkg')
-rw-r--r-- | pkg/gui/help_panel.go | 17 |
1 files changed, 12 insertions, 5 deletions
diff --git a/pkg/gui/help_panel.go b/pkg/gui/help_panel.go index 6ef8def7f..4b3355c46 100644 --- a/pkg/gui/help_panel.go +++ b/pkg/gui/help_panel.go @@ -55,7 +55,9 @@ func (gui *Gui) handleHelp(g *gocui.Gui, v *gocui.View) error { helpView, _ := g.SetView("help", maxX-x, y, x, maxY-y, 0) helpView.Title = strings.Title(gui.Tr.SLocalize("help")) - gui.renderHelpOptions(g) + if err := gui.renderHelpOptions(g); err != nil { + return err + } for _, binding := range bindings { if binding.ViewName == v.Name() && binding.Description != "" && binding.KeyReadable != "" { @@ -69,12 +71,17 @@ func (gui *Gui) handleHelp(g *gocui.Gui, v *gocui.View) error { content += "second\n" content += "third\n" */ - gui.renderString(g, "help", content) + + if err := gui.renderString(g, "help", content); err != nil { + return err + } g.Update(func(g *gocui.Gui) error { - g.SetViewOnTop("help") - gui.switchFocus(g, v, helpView) - return nil + _, err := g.SetViewOnTop("help") + if err != nil { + return err + } + return gui.switchFocus(g, v, helpView) }) return nil } |