summaryrefslogtreecommitdiff
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authorIbrahim Serdar Acikgoz <serdaracikgoz86@gmail.com>2018-12-28 11:03:29 +0300
committerGitHub <noreply@github.com>2018-12-28 11:03:29 +0300
commitb7526002579436856e02173de4445e543aa77b33 (patch)
treec830da1154525d87cd009c32797ca40bdb15153a /pkg/gui/gui.go
parentHotfix 40 (#45) (diff)
downloadgitbatch-b7526002579436856e02173de4445e543aa77b33.tar.gz
fixes a semantic error while loading repositories (#47)
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go20
1 files changed, 10 insertions, 10 deletions
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