1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

more work on managing focus when applying patch command

This commit is contained in:
Jesse Duffield
2019-11-05 17:57:59 +11:00
parent 1a38bfb76d
commit 10fe88a2cf
5 changed files with 40 additions and 12 deletions

View File

@ -5,6 +5,10 @@ import (
)
func (gui *Gui) refreshPatchBuildingPanel() error {
if gui.GitCommand.PatchManager == nil {
return gui.handleEscapePatchBuildingPanel(gui.g, nil)
}
gui.State.SplitMainPanel = true
// get diff from commit file that's currently selected
@ -23,8 +27,6 @@ func (gui *Gui) refreshPatchBuildingPanel() error {
return err
}
gui.Log.Warn(secondaryDiff)
empty, err := gui.refreshLineByLinePanel(diff, secondaryDiff, false)
if err != nil {
return err
@ -83,6 +85,7 @@ func (gui *Gui) handleRemoveSelectionFromPatch(g *gocui.Gui, v *gocui.View) erro
func (gui *Gui) handleEscapePatchBuildingPanel(g *gocui.Gui, v *gocui.View) error {
gui.State.Panels.LineByLine = nil
gui.State.Contexts["main"] = "normal"
return gui.switchFocus(gui.g, nil, gui.getCommitFilesView())
}