summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-03-03 15:34:53 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-03-03 15:34:53 +1100
commitf07fc31f8ba034981eff6e1adc6a540bb8c64871 (patch)
tree7a83f90591a37509a434007ed3a96929e1755fd2
parent4bb577ab7d6546d92c75d7840e509caf470403c6 (diff)
fixup layout issue that was causing crashes when the window was too small
-rw-r--r--pkg/gui/gui.go15
1 files changed, 5 insertions, 10 deletions
diff --git a/pkg/gui/gui.go b/pkg/gui/gui.go
index 116345876..a6108738b 100644
--- a/pkg/gui/gui.go
+++ b/pkg/gui/gui.go
@@ -282,11 +282,12 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
leftSideWidth := width / 3
statusFilesBoundary := 2
- filesBranchesBoundary := 2 * height / 5 // height - 20
- commitsBranchesBoundary := 3 * height / 5 // height - 10
- commitsStashBoundary := height - 5 // height - 5
+ filesBranchesBoundary := 2 * height / 5
+ commitsBranchesBoundary := 3 * height / 5
+ optionsTop := height - 2
+ commitsStashBoundary := optionsTop - 3
optionsVersionBoundary := width - max(len(utils.Decolorise(information)), 1)
- minimumHeight := 16
+ minimumHeight := 18
minimumWidth := 10
appStatus := gui.statusManager.getStatusString()
@@ -315,12 +316,6 @@ func (gui *Gui) layout(g *gocui.Gui) error {
_, _ = g.SetViewOnBottom("limit")
g.DeleteView("limit")
- optionsTop := height - 2
- // hiding options if there's not enough space
- if height < 30 {
- optionsTop = height - 1
- }
-
v, err := g.SetView("main", leftSideWidth+panelSpacing, 0, width-1, optionsTop, gocui.LEFT)
if err != nil {
if err.Error() != "unknown view" {