diff options
| author | Kujtim Hoxha <[email protected]> | 2025-04-24 13:13:45 +0200 |
|---|---|---|
| committer | Kujtim Hoxha <[email protected]> | 2025-04-24 16:40:36 +0200 |
| commit | e1b2ce483f51ef734fdaaf53676353f01e6a0dd3 (patch) | |
| tree | 91ad2f13684625583524d5e2e61c7a2c670e0271 /internal | |
| parent | c42d94c465876b3dccfd4244b5efc15f2d3b8bf1 (diff) | |
| download | opencode-e1b2ce483f51ef734fdaaf53676353f01e6a0dd3.tar.gz opencode-e1b2ce483f51ef734fdaaf53676353f01e6a0dd3.zip | |
change additions/removals
Diffstat (limited to 'internal')
| -rw-r--r-- | internal/tui/components/chat/sidebar.go | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/internal/tui/components/chat/sidebar.go b/internal/tui/components/chat/sidebar.go index d330e592b..2cf732230 100644 --- a/internal/tui/components/chat/sidebar.go +++ b/internal/tui/components/chat/sidebar.go @@ -116,13 +116,18 @@ func (m *sidebarCmp) sessionSection() string { func (m *sidebarCmp) modifiedFile(filePath string, additions, removals int) string { stats := "" if additions > 0 && removals > 0 { - stats = styles.BaseStyle.Foreground(styles.ForgroundDim).Render(fmt.Sprintf(" %d additions and %d removals", additions, removals)) + additions := styles.BaseStyle.Foreground(styles.Green).PaddingLeft(1).Render(fmt.Sprintf("+%d", additions)) + removals := styles.BaseStyle.Foreground(styles.Red).PaddingLeft(1).Render(fmt.Sprintf("-%d", removals)) + content := lipgloss.JoinHorizontal(lipgloss.Left, additions, removals) + stats = styles.BaseStyle.Width(lipgloss.Width(content)).Render(content) } else if additions > 0 { - stats = styles.BaseStyle.Foreground(styles.ForgroundDim).Render(fmt.Sprintf(" %d additions", additions)) + additions := fmt.Sprintf(" %s", styles.BaseStyle.PaddingLeft(1).Foreground(styles.Green).Render(fmt.Sprintf("+%d", additions))) + stats = styles.BaseStyle.Width(lipgloss.Width(additions)).Render(additions) } else if removals > 0 { - stats = styles.BaseStyle.Foreground(styles.ForgroundDim).Render(fmt.Sprintf(" %d removals", removals)) + removals := fmt.Sprintf(" %s", styles.BaseStyle.PaddingLeft(1).Foreground(styles.Red).Render(fmt.Sprintf("-%d", removals))) + stats = styles.BaseStyle.Width(lipgloss.Width(removals)).Render(removals) } - filePathStr := styles.BaseStyle.Foreground(styles.Forground).Render(filePath) + filePathStr := styles.BaseStyle.Render(filePath) return styles.BaseStyle. Width(m.width). |
