summaryrefslogtreecommitdiffstats
path: root/pkg/gui/gui.go
diff options
context:
space:
mode:
authormjarkk <mkopenga@gmail.com>2019-05-06 20:04:54 +0200
committermjarkk <mkopenga@gmail.com>2019-05-06 20:04:54 +0200
commit2388c3ee9a5dd70cf953b4fbdd81f847c8a8d24f (patch)
treef90a770415d27e23cfeed36f8ac79858d66837de /pkg/gui/gui.go
parent61890cb9de7ca08427b91712c1484375bcbf81bb (diff)
Fixed some sugestions from jesseduffield
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r--pkg/gui/gui.go14
1 files changed, 5 insertions, 9 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 4e66a1314..101e297e2 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -315,10 +315,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
currView := gui.g.CurrentView()
- currentCyclebleView := "files"
- if currView == nil {
- currentCyclebleView = gui.State.PreviousView
- } else {
+ currentCyclebleView := gui.State.PreviousView
+ if currView != nil {
viewName := currView.Name()
usePreviouseView := true
for _, view := range cyclableViews {
@@ -347,10 +345,8 @@ func (gui *Gui) layout(g *gocui.Gui) error {
if height < 28 {
defaultHeight := 3
- extraHeight := 2
if height < 21 {
defaultHeight = 1
- extraHeight = 0
}
vHeights = map[string]int{
"status": defaultHeight,
@@ -360,7 +356,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
"stash": defaultHeight,
"options": defaultHeight,
}
- vHeights[currentCyclebleView] = height - (defaultHeight * 5) + extraHeight
+ vHeights[currentCyclebleView] = height - defaultHeight*4 - 1
}
optionsVersionBoundary := width - max(len(utils.Decolorise(information)), 1)
@@ -484,7 +480,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
}
- if appStatusView, err := g.SetView("appStatus", -1, height+2, width, height, 0); err != nil {
+ if appStatusView, err := g.SetView("appStatus", -1, height-2, width, height, 0); err != nil {
if err.Error() != "unknown view" {
return err
}
@@ -496,7 +492,7 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
}
- if v, err := g.SetView("information", optionsVersionBoundary-1, height+2, width, height, 0); err != nil {
+ if v, err := g.SetView("information", optionsVersionBoundary-1, height-2, width, height, 0); err != nil {
if err.Error() != "unknown view" {
return err
}