diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 17:57:59 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2019-11-05 19:22:01 +1100 |
commit | 10fe88a2cf79d525f4dfa767b2d0fab1793127e8 (patch) | |
tree | 127b3cf0d06c9ddd114a3863bca01519ffab92fc /pkg/gui/patch_building_panel.go | |
parent | 1a38bfb76d5e2f1b0f03c35fc17f463b0ecf54f1 (diff) |
more work on managing focus when applying patch command
Diffstat (limited to 'pkg/gui/patch_building_panel.go')
-rw-r--r-- | pkg/gui/patch_building_panel.go | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go index 863e464fe..b32253557 100644 --- a/pkg/gui/patch_building_panel.go +++ b/pkg/gui/patch_building_panel.go @@ -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()) } |