mirror of
https://github.com/jesseduffield/lazygit.git
synced 2025-07-30 03:23:08 +03:00
create iconProperties struct and convert iconMaps to use iconProperties
This commit is contained in:
committed by
Jesse Duffield
parent
cbb5fe6007
commit
19e8cafe41
@ -3,6 +3,7 @@ package presentation
|
||||
import (
|
||||
"strings"
|
||||
|
||||
"github.com/gookit/color"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/models"
|
||||
"github.com/jesseduffield/lazygit/pkg/commands/patch"
|
||||
"github.com/jesseduffield/lazygit/pkg/gui/filetree"
|
||||
@ -159,7 +160,9 @@ func getFileLine(hasUnstagedChanges bool, hasStagedChanges bool, name string, di
|
||||
isDirectory := file == nil
|
||||
|
||||
if icons.IsIconEnabled() {
|
||||
output += restColor.Sprintf("%s ", icons.IconForFile(name, isSubmodule, isLinkedWorktree, isDirectory))
|
||||
icon := icons.IconForFile(name, isSubmodule, isLinkedWorktree, isDirectory)
|
||||
paint := color.C256(icon.Color, false)
|
||||
output += paint.Sprint(icon.Icon) + " "
|
||||
}
|
||||
|
||||
output += restColor.Sprint(utils.EscapeSpecialChars(name))
|
||||
@ -198,7 +201,9 @@ func getCommitFileLine(name string, diffName string, commitFile *models.CommitFi
|
||||
isDirectory := commitFile == nil
|
||||
|
||||
if icons.IsIconEnabled() {
|
||||
output += colour.Sprintf("%s ", icons.IconForFile(name, isSubmodule, isLinkedWorktree, isDirectory))
|
||||
icon := icons.IconForFile(name, isSubmodule, isLinkedWorktree, isDirectory)
|
||||
paint := color.C256(icon.Color, false)
|
||||
output += paint.Sprint(icon.Icon) + " "
|
||||
}
|
||||
|
||||
output += colour.Sprint(name)
|
||||
|
Reference in New Issue
Block a user