on main help sign in
change additions/removals
commite1b2ce483f51ef734fdaaf53676353f01e6a0dd3 authorKujtim Hoxha <kujtimii.h@gmail.com> dateThu 24 Apr 2025, 13:13 (2 years ago) parentc42d94c
1 file changed+9−4
internal/tui/components/chat/sidebar.go+9−4
internal/tui/components/chat/sidebar.go+9−4
@@ -116,13 +116,18 @@ func (m *sidebarCmp) sessionSection() string {
116116func (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).