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

Add config setting to suppress showing file icons

This commit is contained in:
Stefan Haller
2024-01-12 13:16:25 +01:00
parent 3215839524
commit 36134006c5
7 changed files with 25 additions and 8 deletions

View File

@ -4,6 +4,7 @@ import (
"github.com/jesseduffield/lazygit/pkg/commands/models"
"github.com/jesseduffield/lazygit/pkg/gui/filetree"
"github.com/jesseduffield/lazygit/pkg/gui/presentation"
"github.com/jesseduffield/lazygit/pkg/gui/presentation/icons"
"github.com/jesseduffield/lazygit/pkg/gui/style"
"github.com/jesseduffield/lazygit/pkg/gui/types"
"github.com/samber/lo"
@ -33,7 +34,8 @@ func NewCommitFilesContext(c *ContextCommon) *CommitFilesContext {
return [][]string{{style.FgRed.Sprint("(none)")}}
}
lines := presentation.RenderCommitFileTree(viewModel, c.Git().Patch.PatchBuilder)
showFileIcons := icons.IsIconEnabled() && c.UserConfig.Gui.ShowFileIcons
lines := presentation.RenderCommitFileTree(viewModel, c.Git().Patch.PatchBuilder, showFileIcons)
return lo.Map(lines, func(line string, _ int) []string {
return []string{line}
})