summaryrefslogtreecommitdiffstats
path: root/pkg/gui/presentation
diff options
context:
space:
mode:
authorJesse Duffield <jessedduffield@gmail.com>2020-09-28 09:14:32 +1000
committerJesse Duffield <jessedduffield@gmail.com>2020-09-29 18:21:59 +1000
commitb8da166ab1c66671d681bc2454b911993716de58 (patch)
tree6c85b73b530d2771c901024dbd1cc762ccbfa208 /pkg/gui/presentation
parentca437a65046d5af0c90c337b125af4538e625502 (diff)
support discarding submodule changes
Diffstat (limited to 'pkg/gui/presentation')
-rw-r--r--pkg/gui/presentation/files.go8
1 files changed, 4 insertions, 4 deletions
diff --git a/pkg/gui/presentation/files.go b/pkg/gui/presentation/files.go
index 6493e1024..f02aee91f 100644
--- a/pkg/gui/presentation/files.go
+++ b/pkg/gui/presentation/files.go
@@ -7,19 +7,19 @@ import (
"github.com/jesseduffield/lazygit/pkg/utils"
)
-func GetFileListDisplayStrings(files []*commands.File, diffName string) [][]string {
+func GetFileListDisplayStrings(files []*commands.File, diffName string, submoduleConfigs []*commands.SubmoduleConfig) [][]string {
lines := make([][]string, len(files))
for i := range files {
diffed := files[i].Name == diffName
- lines[i] = getFileDisplayStrings(files[i], diffed)
+ lines[i] = getFileDisplayStrings(files[i], diffed, submoduleConfigs)
}
return lines
}
// getFileDisplayStrings returns the display string of branch
-func getFileDisplayStrings(f *commands.File, diffed bool) []string {
+func getFileDisplayStrings(f *commands.File, diffed bool, submoduleConfigs []*commands.SubmoduleConfig) []string {
// potentially inefficient to be instantiating these color
// objects with each render
red := color.New(color.FgRed)
@@ -55,7 +55,7 @@ func getFileDisplayStrings(f *commands.File, diffed bool) []string {
output += secondCharCl.Sprint(secondChar)
output += restColor.Sprintf(" %s", f.Name)
- if f.IsSubmodule {
+ if f.IsSubmodule(submoduleConfigs) {
output += utils.ColoredString(" (submodule)", theme.DefaultTextColor)
}