1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-30 03:23:08 +03:00

Address PR comments

This commit is contained in:
Joel Baranick
2022-09-10 22:36:47 -07:00
committed by Jesse Duffield
parent 1ce9a87544
commit db02c13bf6
7 changed files with 74 additions and 67 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/samber/lo"
)
type WorktreesContext struct {
@ -22,7 +23,12 @@ func NewWorktreesContext(c *ContextCommon) *WorktreesContext {
)
getDisplayStrings := func(startIdx int, length int) [][]string {
return presentation.GetWorktreeListDisplayStrings(c.Model().Worktrees)
return lo.Map(c.Model().Worktrees, func(worktree *models.Worktree, _ int) []string {
return presentation.GetWorktreeDisplayString(
c.Git().Worktree.IsCurrentWorktree(worktree),
c.Git().Worktree.IsWorktreePathMissing(worktree),
worktree)
})
}
return &WorktreesContext{