Introduce options struct for RenderPatchForFile

We're going to add another argument in the next commit, and that's getting a bit
much, especially when most of the arguments are bool and you only see true and
false at the call sites without knowing what they mean.
This commit is contained in:
Stefan Haller 2024-06-21 19:52:49 +02:00
parent 1a76a7da09
commit 13a35408e6
2 changed files with 27 additions and 8 deletions

View file

@ -3,6 +3,7 @@ package helpers
import (
"errors"
"github.com/jesseduffield/lazygit/pkg/commands/patch"
"github.com/jesseduffield/lazygit/pkg/commands/types/enums"
"github.com/jesseduffield/lazygit/pkg/gui/patch_exploring"
"github.com/jesseduffield/lazygit/pkg/gui/types"
@ -80,7 +81,11 @@ func (self *PatchBuildingHelper) RefreshPatchBuildingPanel(opts types.OnFocusOpt
return err
}
secondaryDiff := self.c.Git().Patch.PatchBuilder.RenderPatchForFile(path, false, false)
secondaryDiff := self.c.Git().Patch.PatchBuilder.RenderPatchForFile(patch.RenderPatchForFileOpts{
Filename: path,
Plain: false,
Reverse: false,
})
context := self.c.Contexts().CustomPatchBuilder