1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00
This commit is contained in:
Jesse Duffield
2020-08-18 22:02:35 +10:00
parent 3c87ff4eff
commit f5b22d94d9
14 changed files with 259 additions and 152 deletions

View File

@ -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
}