1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-31 14:24:25 +03:00

generalise patch building stuff

This commit is contained in:
Jesse Duffield
2020-08-21 20:31:21 +10:00
parent 609f3f4bfa
commit e6a1bd6566
6 changed files with 27 additions and 28 deletions

View File

@ -6,7 +6,7 @@ import (
)
func (gui *Gui) refreshPatchBuildingPanel(selectedLineIdx int) error {
if !gui.GitCommand.PatchManager.CommitSelected() {
if !gui.GitCommand.PatchManager.Active() {
return gui.handleEscapePatchBuildingPanel()
}
@ -88,7 +88,7 @@ func (gui *Gui) handleEscapePatchBuildingPanel() error {
func (gui *Gui) refreshSecondaryPatchPanel() error {
// TODO: swap out for secondaryPatchPanelUpdateOpts
if gui.GitCommand.PatchManager.CommitSelected() {
if gui.GitCommand.PatchManager.Active() {
gui.splitMainPanel(true)
secondaryView := gui.getSecondaryView()
secondaryView.Highlight = true
@ -106,7 +106,7 @@ func (gui *Gui) refreshSecondaryPatchPanel() error {
}
func (gui *Gui) secondaryPatchPanelUpdateOpts() *viewUpdateOpts {
if gui.GitCommand.PatchManager.CommitSelected() {
if gui.GitCommand.PatchManager.Active() {
patch := gui.GitCommand.PatchManager.RenderAggregatedPatchColored(false)
return &viewUpdateOpts{