mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-28 16:02:01 +03:00
reset patch builder when we've escaped from the building phase and nothing has been added
This commit is contained in:
@ -5,7 +5,7 @@ import (
|
||||
)
|
||||
|
||||
func (gui *Gui) refreshPatchBuildingPanel() error {
|
||||
if gui.GitCommand.PatchManager.IsEmpty() {
|
||||
if !gui.GitCommand.PatchManager.CommitSelected() {
|
||||
return gui.handleEscapePatchBuildingPanel(gui.g, nil)
|
||||
}
|
||||
|
||||
@ -87,11 +87,16 @@ func (gui *Gui) handleEscapePatchBuildingPanel(g *gocui.Gui, v *gocui.View) erro
|
||||
gui.State.Panels.LineByLine = nil
|
||||
gui.State.Contexts["main"] = "normal"
|
||||
|
||||
if gui.GitCommand.PatchManager.IsEmpty() {
|
||||
gui.GitCommand.PatchManager.Reset()
|
||||
gui.State.SplitMainPanel = false
|
||||
}
|
||||
|
||||
return gui.switchFocus(gui.g, nil, gui.getCommitFilesView())
|
||||
}
|
||||
|
||||
func (gui *Gui) refreshSecondaryPatchPanel() error {
|
||||
if !gui.GitCommand.PatchManager.IsEmpty() {
|
||||
if gui.GitCommand.PatchManager.CommitSelected() {
|
||||
gui.State.SplitMainPanel = true
|
||||
secondaryView := gui.getSecondaryView()
|
||||
secondaryView.Highlight = true
|
||||
|
Reference in New Issue
Block a user