1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-01-06 03:53:59 +02:00

hide view if not specified in dimensions object

This commit is contained in:
Jesse Duffield 2020-08-17 20:45:44 +10:00
parent dc183c0d82
commit 62a662054b

View File

@ -73,8 +73,18 @@ func (gui *Gui) layout(g *gocui.Gui) error {
}
}
setViewFromDimensions := func(viewName string, boxName string, frame bool) (*gocui.View, error) {
dimensionsObj := viewDimensions[boxName]
setViewFromDimensions := func(viewName string, windowName string, frame bool) (*gocui.View, error) {
dimensionsObj, ok := viewDimensions[windowName]
if !ok {
// view not specified in dimensions object: so create the view and hide it
view, err := g.SetView(viewName, 0, 0, 0, 0, 0)
if err != nil {
return view, err
}
return g.SetViewOnBottom(viewName)
}
frameOffset := 1
if frame {
frameOffset = 0