mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-06-06 23:46:13 +02:00
more error checks
This commit is contained in:
parent
28a9594ef7
commit
8a01d11202
@ -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, _ := g.SetView("help", maxX-x, y, x, maxY-y, 0)
|
||||||
helpView.Title = strings.Title(gui.Tr.SLocalize("help"))
|
helpView.Title = strings.Title(gui.Tr.SLocalize("help"))
|
||||||
|
|
||||||
gui.renderHelpOptions(g)
|
if err := gui.renderHelpOptions(g); err != nil {
|
||||||
|
return err
|
||||||
|
}
|
||||||
|
|
||||||
for _, binding := range bindings {
|
for _, binding := range bindings {
|
||||||
if binding.ViewName == v.Name() && binding.Description != "" && binding.KeyReadable != "" {
|
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 += "second\n"
|
||||||
content += "third\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.Update(func(g *gocui.Gui) error {
|
||||||
g.SetViewOnTop("help")
|
_, err := g.SetViewOnTop("help")
|
||||||
gui.switchFocus(g, v, helpView)
|
if err != nil {
|
||||||
return nil
|
return err
|
||||||
|
}
|
||||||
|
return gui.switchFocus(g, v, helpView)
|
||||||
})
|
})
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user