Skip to content

Commit aedf996

Browse files
committed
change additions/removals
1 parent cc514da commit aedf996

File tree

1 file changed

+9
-4
lines changed

1 file changed

+9
-4
lines changed

internal/tui/components/chat/sidebar.go

+9-4
Original file line numberDiff line numberDiff line change
@@ -116,13 +116,18 @@ func (m *sidebarCmp) sessionSection() string {
116116
func (m *sidebarCmp) modifiedFile(filePath string, additions, removals int) string {
117117
stats := ""
118118
if additions > 0 && removals > 0 {
119-
stats = styles.BaseStyle.Foreground(styles.ForgroundDim).Render(fmt.Sprintf(" %d additions and %d removals", additions, removals))
119+
additions := styles.BaseStyle.Foreground(styles.Green).PaddingLeft(1).Render(fmt.Sprintf("+%d", additions))
120+
removals := styles.BaseStyle.Foreground(styles.Red).PaddingLeft(1).Render(fmt.Sprintf("-%d", removals))
121+
content := lipgloss.JoinHorizontal(lipgloss.Left, additions, removals)
122+
stats = styles.BaseStyle.Width(lipgloss.Width(content)).Render(content)
120123
} else if additions > 0 {
121-
stats = styles.BaseStyle.Foreground(styles.ForgroundDim).Render(fmt.Sprintf(" %d additions", additions))
124+
additions := fmt.Sprintf(" %s", styles.BaseStyle.PaddingLeft(1).Foreground(styles.Green).Render(fmt.Sprintf("+%d", additions)))
125+
stats = styles.BaseStyle.Width(lipgloss.Width(additions)).Render(additions)
122126
} else if removals > 0 {
123-
stats = styles.BaseStyle.Foreground(styles.ForgroundDim).Render(fmt.Sprintf(" %d removals", removals))
127+
removals := fmt.Sprintf(" %s", styles.BaseStyle.PaddingLeft(1).Foreground(styles.Red).Render(fmt.Sprintf("-%d", removals)))
128+
stats = styles.BaseStyle.Width(lipgloss.Width(removals)).Render(removals)
124129
}
125-
filePathStr := styles.BaseStyle.Foreground(styles.Forground).Render(filePath)
130+
filePathStr := styles.BaseStyle.Render(filePath)
126131

127132
return styles.BaseStyle.
128133
Width(m.width).

0 commit comments

Comments
 (0)