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

centralise split main panel code

This commit is contained in:
Jesse Duffield
2020-08-18 08:26:40 +10:00
parent a12d18146c
commit 0f7b2c45d7
13 changed files with 32 additions and 26 deletions

View File

@ -368,3 +368,16 @@ func (gui *Gui) clearEditorView(v *gocui.View) {
_ = v.SetCursor(0, 0)
_ = v.SetOrigin(0, 0)
}
func (gui *Gui) splitMainPanel(state bool) {
gui.State.SplitMainPanel = state
// no need to set view on bottom when state is false: it will have zero size anyway thanks to our view arrangement code.
if state {
_, _ = gui.g.SetViewOnTop("secondary")
}
}
func (gui *Gui) isMainPanelSplit() bool {
return gui.State.SplitMainPanel
}