MCPcopy
hub / github.com/jesseduffield/lazygit / formatFileStatus

Function formatFileStatus

pkg/gui/presentation/files.go:184–201  ·  view source on GitHub ↗
(file *models.File, restColor style.TextStyle)

Source from the content-addressed store, hash-verified

182}
183
184func formatFileStatus(file *models.File, restColor style.TextStyle) string {
185 firstChar := file.ShortStatus[0:1]
186 firstCharCl := style.FgGreen
187 switch firstChar {
188 case "?":
189 firstCharCl = theme.UnstagedChangesColor
190 case " ":
191 firstCharCl = restColor
192 }
193
194 secondChar := file.ShortStatus[1:2]
195 secondCharCl := theme.UnstagedChangesColor
196 if secondChar == " " {
197 secondCharCl = restColor
198 }
199
200 return firstCharCl.Sprint(firstChar) + secondCharCl.Sprint(secondChar)
201}
202
203func formatLineChanges(linesAdded, linesDeleted int) string {
204 output := ""

Callers 1

getFileLineFunction · 0.85

Calls 1

SprintMethod · 0.65

Tested by

no test coverage detected