1
0
mirror of https://github.com/jesseduffield/lazygit.git synced 2025-07-28 16:02:01 +03:00

feat(gui): show commit icons

This commit is contained in:
Ryooooooga
2022-04-23 10:41:40 +09:00
parent b07aeda5a6
commit cb13fe7f46
5 changed files with 34 additions and 10 deletions

View File

@ -12,8 +12,6 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
var showFileIcon = false
const (
EXPANDED_ARROW = "▼"
COLLAPSED_ARROW = "►"
@ -160,7 +158,7 @@ func getFileLine(hasUnstagedChanges bool, hasStagedChanges bool, name string, di
isSubmodule := file != nil && file.IsSubmodule(submoduleConfigs)
isDirectory := file == nil
if showFileIcon {
if icons.IsIconEnabled() {
output += restColor.Sprintf("%s ", icons.IconForFile(name, isSubmodule, isDirectory))
}
@ -199,7 +197,7 @@ func getCommitFileLine(name string, diffName string, commitFile *models.CommitFi
isSubmodule := false // TODO: submodule
isDirectory := commitFile == nil
if showFileIcon {
if icons.IsIconEnabled() {
output += colour.Sprintf("%s ", icons.IconForFile(name, isSubmodule, isDirectory))
}
@ -223,7 +221,3 @@ func getColorForChangeStatus(changeStatus string) style.TextStyle {
return theme.DefaultTextColor
}
}
func SetShowFileIcon(show bool) {
showFileIcon = show
}