small improvements

This commit is contained in:
Kujtim Hoxha
2025-04-17 13:45:26 +02:00
parent caea293759
commit c24e3c18e0
11 changed files with 149 additions and 37 deletions

View File

@@ -127,7 +127,7 @@ func (m *sidebarCmp) modifiedFiles() string {
// If no modified files, show a placeholder message
if m.modFiles == nil || len(m.modFiles) == 0 {
message := "No modified files"
remainingWidth := m.width - lipgloss.Width(modifiedFiles)
remainingWidth := m.width - lipgloss.Width(message)
if remainingWidth > 0 {
message += strings.Repeat(" ", remainingWidth)
}
@@ -223,6 +223,9 @@ func (m *sidebarCmp) loadModifiedFiles(ctx context.Context) {
if initialVersion.ID == "" {
continue
}
if initialVersion.Content == file.Content {
continue
}
// Calculate diff between initial and latest version
_, additions, removals := diff.GenerateDiff(initialVersion.Content, file.Content, file.Path)