1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +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

@ -10,7 +10,7 @@ func (gui *Gui) refreshPatchBuildingPanel(selectedLineIdx int) error {
return gui.handleEscapePatchBuildingPanel()
}
gui.State.SplitMainPanel = true
gui.splitMainPanel(true)
gui.getMainView().Title = "Patch"
gui.getSecondaryView().Title = "Custom Patch"
@ -80,7 +80,7 @@ func (gui *Gui) handleEscapePatchBuildingPanel() error {
if gui.GitCommand.PatchManager.IsEmpty() {
gui.GitCommand.PatchManager.Reset()
gui.State.SplitMainPanel = false
gui.splitMainPanel(false)
}
return gui.switchContext(gui.Contexts.BranchCommits.Files.Context)
@ -88,7 +88,7 @@ func (gui *Gui) handleEscapePatchBuildingPanel() error {
func (gui *Gui) refreshSecondaryPatchPanel() error {
if gui.GitCommand.PatchManager.CommitSelected() {
gui.State.SplitMainPanel = true
gui.splitMainPanel(true)
secondaryView := gui.getSecondaryView()
secondaryView.Highlight = true
secondaryView.Wrap = false
@ -98,7 +98,7 @@ func (gui *Gui) refreshSecondaryPatchPanel() error {
return nil
})
} else {
gui.State.SplitMainPanel = false
gui.splitMainPanel(false)
}
return nil