1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

handling when to show the split panel

This commit is contained in:
Jesse Duffield
2019-11-05 15:11:35 +11:00
parent 6d5d054c30
commit beaebb7dc7
6 changed files with 38 additions and 23 deletions

View File

@ -31,7 +31,7 @@ func (gui *Gui) refreshPatchBuildingPanel() error {
}
if empty {
return gui.handleStagingEscape(gui.g, nil)
return gui.handleEscapePatchBuildingPanel(gui.g, nil)
}
return nil
@ -86,3 +86,20 @@ func (gui *Gui) handleEscapePatchBuildingPanel(g *gocui.Gui, v *gocui.View) erro
return gui.switchFocus(gui.g, nil, gui.getCommitFilesView())
}
func (gui *Gui) refreshSecondaryPatchPanel() error {
if gui.GitCommand.PatchManager != nil {
gui.State.SplitMainPanel = true
secondaryView := gui.getSecondaryView()
secondaryView.Highlight = true
secondaryView.Wrap = false
gui.g.Update(func(*gocui.Gui) error {
return gui.setViewContent(gui.g, gui.getSecondaryView(), gui.GitCommand.PatchManager.RenderAggregatedPatchColored(false))
})
} else {
gui.State.SplitMainPanel = false
}
return nil
}