diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-18 22:02:35 +1000 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2020-08-23 14:29:18 +1000 |
commit | f5b22d94d939b0fc1aff433686e891e0a7507950 (patch) | |
tree | 9812c4c7f3855d7e3fe973dacf5533ef04463c3d /pkg/gui/patch_building_panel.go | |
parent | 3c87ff4eff46449d5e697e954b3bdf01d2c76f19 (diff) |
WIP
Diffstat (limited to 'pkg/gui/patch_building_panel.go')
-rw-r--r-- | pkg/gui/patch_building_panel.go | 18 |
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 +} |