diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-03 15:34:53 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-03-03 15:34:53 +1100 |
commit | f07fc31f8ba034981eff6e1adc6a540bb8c64871 (patch) | |
tree | 7a83f90591a37509a434007ed3a96929e1755fd2 /pkg/gui/gui.go | |
parent | 4bb577ab7d6546d92c75d7840e509caf470403c6 (diff) |
fixup layout issue that was causing crashes when the window was too small
Diffstat (limited to 'pkg/gui/gui.go')
-rw-r--r-- | pkg/gui/gui.go | 15 |
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" { |