From b7526002579436856e02173de4445e543aa77b33 Mon Sep 17 00:00:00 2001 From: Ibrahim Serdar Acikgoz Date: Fri, 28 Dec 2018 11:03:29 +0300 Subject: fixes a semantic error while loading repositories (#47) --- main.go | 2 +- pkg/gui/gui.go | 20 ++++++++++---------- 2 files changed, 11 insertions(+), 11 deletions(-) diff --git a/main.go b/main.go index 8edebeb..7ef48b8 100644 --- a/main.go +++ b/main.go @@ -15,7 +15,7 @@ var ( ) func main() { - kingpin.Version("gitbatch version 0.2.0") + kingpin.Version("gitbatch version 0.2.1") // parse the command line flag and options kingpin.Parse() diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 2e1f2b2..c839860 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -101,6 +101,16 @@ func (gui *Gui) Run() error { return err } + defer g.Close() + gui.g = g + g.Highlight = true + g.SelFgColor = gocui.ColorGreen + + // If InputEsc is true, when ESC sequence is in the buffer and it doesn't + // match any known sequence, ESC means KeyEsc. + g.InputEsc = true + g.SetManagerFunc(gui.layout) + // start an async view apart from this loop to show loading screen go func(g_ui *Gui) { maxX, maxY := g.Size() @@ -131,16 +141,6 @@ func (gui *Gui) Run() error { gui.fillMain(g) }(gui) - defer g.Close() - gui.g = g - g.Highlight = true - g.SelFgColor = gocui.ColorGreen - - // If InputEsc is true, when ESC sequence is in the buffer and it doesn't - // match any known sequence, ESC means KeyEsc. - g.InputEsc = true - g.SetManagerFunc(gui.layout) - if err := gui.generateKeybindings(); err != nil { log.Error("Keybindings could not be created.") return err -- cgit v1.2.3