diff options
author | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-19 12:26:30 +1100 |
---|---|---|
committer | Jesse Duffield <jessedduffield@gmail.com> | 2022-03-24 20:14:41 +1100 |
commit | c7a629c4401ae0d4aad06767c88ce1e9e418dbf3 (patch) | |
tree | 2ff5599041030a423e02214989f07129772337c6 /pkg/commands/patch/patch_parser.go | |
parent | dde30fa104347ab9c01f82b7886864b473e6f51c (diff) |
make more use of generics
Diffstat (limited to 'pkg/commands/patch/patch_parser.go')
-rw-r--r-- | pkg/commands/patch/patch_parser.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/pkg/commands/patch/patch_parser.go b/pkg/commands/patch/patch_parser.go index c2be120c9..3810d8a29 100644 --- a/pkg/commands/patch/patch_parser.go +++ b/pkg/commands/patch/patch_parser.go @@ -7,6 +7,7 @@ import ( "github.com/jesseduffield/lazygit/pkg/gui/style" "github.com/jesseduffield/lazygit/pkg/theme" "github.com/jesseduffield/lazygit/pkg/utils" + "github.com/samber/lo" "github.com/sirupsen/logrus" ) @@ -186,7 +187,7 @@ func (p *PatchParser) Render(firstLineIndex int, lastLineIndex int, incLineIndic renderedLines := make([]string, len(p.PatchLines)) for index, patchLine := range p.PatchLines { selected := index >= firstLineIndex && index <= lastLineIndex - included := utils.IncludesInt(incLineIndices, index) + included := lo.Contains(incLineIndices, index) renderedLines[index] = patchLine.render(selected, included) } result := strings.Join(renderedLines, "\n") |