summaryrefslogtreecommitdiffstats
path: root/pkg/gui/patch_building_panel.go
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-08-18 22:02:35 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-08-23 14:29:18 +1000
commitf5b22d94d939b0fc1aff433686e891e0a7507950 (patch)
tree9812c4c7f3855d7e3fe973dacf5533ef04463c3d /pkg/gui/patch_building_panel.go
parent3c87ff4eff46449d5e697e954b3bdf01d2c76f19 (diff)
WIP
Diffstat (limited to 'pkg/gui/patch_building_panel.go')
-rw-r--r--pkg/gui/patch_building_panel.go18
1 files changed, 17 insertions, 1 deletions
diff --git a/pkg/gui/patch_building_panel.go b/pkg/gui/patch_building_panel.go
index 67caba0ae..a2b872f36 100644
--- a/pkg/gui/patch_building_panel.go
+++ b/pkg/gui/patch_building_panel.go
@@ -80,13 +80,14 @@ func (gui *Gui) handleEscapePatchBuildingPanel() error {
if gui.GitCommand.PatchManager.IsEmpty() {
gui.GitCommand.PatchManager.Reset()
- gui.splitMainPanel(false)
}
return gui.switchContext(gui.Contexts.BranchCommits.Files.Context)
}
func (gui *Gui) refreshSecondaryPatchPanel() error {
+ // TODO: swap out for secondaryPatchPanelUpdateOpts
+
if gui.GitCommand.PatchManager.CommitSelected() {
gui.splitMainPanel(true)
secondaryView := gui.getSecondaryView()
@@ -103,3 +104,18 @@ func (gui *Gui) refreshSecondaryPatchPanel() error {
return nil
}
+
+func (gui *Gui) secondaryPatchPanelUpdateOpts() *viewUpdateOpts {
+ if gui.GitCommand.PatchManager.CommitSelected() {
+ patch := gui.GitCommand.PatchManager.RenderAggregatedPatchColored(false)
+
+ return &viewUpdateOpts{
+ title: "Custom Patch",
+ noWrap: true,
+ highlight: true,
+ task: gui.createRenderStringWithoutScrollTask(patch),
+ }
+ }
+
+ return nil
+}