mirror of
https://github.com/jesseduffield/lazygit.git
synced 2026-09-10 07:36:27 -04:00
Scale the minimum window height with the panel count
In squashed mode (short terminals) the unfocused side panels each reserve a row and the focused panel takes whatever is left, so once the unfocused panels' rows fill the height the focused panel collapses to nothing and panels below it render off-screen. The fixed floor of 9 was tuned for five panels; with the panel count now configurable (and promotion allowing up to ten), grow the floor by one per panel so we show the "not enough space" view instead of a broken layout. Five panels still floor at 9. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
This commit is contained in:
parent
da8ef69133
commit
e396483deb
|
|
@ -133,7 +133,12 @@ func (gui *Gui) layout(g *gocui.Gui) error {
|
|||
}
|
||||
}
|
||||
|
||||
minimumHeight := 9
|
||||
// When the screen is too short the side panels are squashed, with the
|
||||
// unfocused ones taking one row each and the focused one taking the rest. The
|
||||
// more panels there are, the more rows the unfocused ones reserve, so the
|
||||
// floor below which there's no room left for the focused panel grows with the
|
||||
// panel count. Keep the historical floor of 9 for the default five panels.
|
||||
minimumHeight := max(9, len(gui.helpers.Window.SideWindows())+4)
|
||||
minimumWidth := 10
|
||||
gui.Views.Limit.Visible = height < minimumHeight || width < minimumWidth
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue