diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-01-31 23:16:55 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-02-01 00:23:22 +1100 |
commit | cf6be928a375ea459222de69c3aa1da12ff9a23a (patch) | |
tree | a76534eb4675b50db052de378e66ebda1e63d332 /pkg/gui/gui.go | |
parent | c907c55144b4875d8193bbeb620b2dcc2793942e (diff) |
only rerender app status when we need to
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 11 |
1 files changed, 1 insertions, 10 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go index 6107c456f..c419f5dc9 100644 --- a/pkg/gui/gui.go +++ b/pkg/gui/gui.go @@ -618,7 +618,7 @@ func (gui *Gui) layout(g *gocui.Gui) error { } } - if appStatusView, err := g.SetView("appStatus", hiddenViewOffset, hiddenViewOffset, hiddenViewOffset+10, hiddenViewOffset+10, 0); err != nil { + if appStatusView, err := g.SetView("appStatus", -1, height-2, width, height, 0); err != nil { if err.Error() != "unknown view" { return err } @@ -776,14 +776,6 @@ func (gui *Gui) fetch(g *gocui.Gui, v *gocui.View, canAskForCredentials bool) (u return unamePassOpend, err } -func (gui *Gui) renderAppStatus() error { - appStatus := gui.statusManager.getStatusString() - if appStatus != "" { - return gui.renderString(gui.g, "appStatus", appStatus) - } - return nil -} - func (gui *Gui) renderGlobalOptions() error { return gui.renderOptionsMap(map[string]string{ fmt.Sprintf("%s/%s", gui.getKeyDisplay("universal.scrollUpMain"), gui.getKeyDisplay("universal.scrollDownMain")): gui.Tr.SLocalize("scroll"), @@ -862,7 +854,6 @@ func (gui *Gui) Run() error { } gui.goEvery(time.Second*10, gui.stopChan, gui.refreshFiles) - gui.goEvery(time.Millisecond*50, gui.stopChan, gui.renderAppStatus) g.SetManager(gocui.ManagerFunc(gui.layout), gocui.ManagerFunc(gui.getFocusLayout())) |