summaryrefslogtreecommitdiffstats
path: root/pkg/gui/patch_building_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2019-11-05 15:11:35 +1100
committerJesse Duffield <jessedduffield@gmail.com>2019-11-05 19:22:01 +1100
commitbeaebb7dc7576d69c43e6b1f3aabc83ff312b3fe (patch)
treee007f3a887fc8b3c676a4f27cd34853eb46efda0 /pkg/gui/patch_building_panel.go
parent6d5d054c30050bc66c9c3e8697982c6c801a2a62 (diff)
handling when to show the split panel
Diffstat (limited to 'pkg/gui/patch_building_panel.go')
-rw-r--r--pkg/gui/patch_building_panel.go19
1 files changed, 18 insertions, 1 deletions
diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go
index cc16111b7..863e464fe 100644
--- a/pkg/gui/patch_building_panel.go
+++ b/pkg/gui/patch_building_panel.go
@@ -31,7 +31,7 @@ func (gui *Gui) refreshPatchBuildingPanel() error {
}
if empty {
- return gui.handleStagingEscape(gui.g, nil)
+ return gui.handleEscapePatchBuildingPanel(gui.g, nil)
}
return nil
@@ -86,3 +86,20 @@ func (gui *Gui) handleEscapePatchBuildingPanel(g *gocui.Gui, v *gocui.View) erro
return gui.switchFocus(gui.g, nil, gui.getCommitFilesView())
}
+
+func (gui *Gui) refreshSecondaryPatchPanel() error {
+ if gui.GitCommand.PatchManager != nil {
+ gui.State.SplitMainPanel = true
+ secondaryView := gui.getSecondaryView()
+ secondaryView.Highlight = true
+ secondaryView.Wrap = false
+
+ gui.g.Update(func(*gocui.Gui) error {
+ return gui.setViewContent(gui.g, gui.getSecondaryView(), gui.GitCommand.PatchManager.RenderAggregatedPatchColored(false))
+ })
+ } else {
+ gui.State.SplitMainPanel = false
+ }
+
+ return nil
+}