From f07fc31f8ba034981eff6e1adc6a540bb8c64871 Mon Sep 17 00:00:00 2001 From: Jesse Duffield Date: Sun, 3 Mar 2019 15:34:53 +1100 Subject: fixup layout issue that was causing crashes when the window was too small --- pkg/gui/gui.go | 15 +++++---------- 1 file changed, 5 insertions(+), 10 deletions(-) (limited to 'pkg') 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" { -- cgit v1.2.3