1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-06-15 00:15:32 +02:00

allow rendering to main panels from anywhere

This commit is contained in:
Jesse Duffield
2022-08-07 11:34:53 +10:00
parent fcf20f3b93
commit d73a236d7c
19 changed files with 329 additions and 280 deletions

View File

@ -16,20 +16,20 @@ func (gui *Gui) commitFilesRenderToMain() error {
from, reverse := gui.State.Modes.Diffing.GetFromAndReverseArgsForDiff(ref.ParentRefName())
cmdObj := gui.git.WorkingTree.ShowFileDiffCmdObj(from, to, reverse, node.GetPath(), false)
task := NewRunPtyTask(cmdObj.GetCmd())
task := types.NewRunPtyTask(cmdObj.GetCmd())
pair := gui.normalMainContextPair()
pair := gui.c.MainViewPairs().Normal
if node.File != nil {
pair = gui.patchBuildingMainContextPair()
pair = gui.c.MainViewPairs().PatchBuilding
}
return gui.refreshMainViews(refreshMainOpts{
pair: pair,
main: &viewUpdateOpts{
title: gui.Tr.Patch,
task: task,
return gui.c.RenderToMainViews(types.RefreshMainOpts{
Pair: pair,
Main: &types.ViewUpdateOpts{
Title: gui.Tr.Patch,
Task: task,
},
secondary: gui.secondaryPatchPanelUpdateOpts(),
Secondary: gui.secondaryPatchPanelUpdateOpts(),
})
}