From d3d5c30ea8322684f2b33813cebbc31f2e7cce77 Mon Sep 17 00:00:00 2001 From: Matthew Breedlove Date: Fri, 8 Aug 2025 21:50:58 -0400 Subject: [PATCH] Fix dangling separators. Fix empty git status. --- src/ccstatusline.ts | 11 ++++++----- 1 file changed, 6 insertions(+), 5 deletions(-) diff --git a/src/ccstatusline.ts b/src/ccstatusline.ts index 560f97e..652f7f0 100644 --- a/src/ccstatusline.ts +++ b/src/ccstatusline.ts @@ -164,11 +164,7 @@ function getGitChanges(): { insertions: number; deletions: number } | null { totalDeletions += deleteMatch?.[1] ? parseInt(deleteMatch[1], 10) : 0; } - // Return null if no changes at all (so the element doesn't appear) - if (totalInsertions === 0 && totalDeletions === 0) { - return null; - } - + // Always return the changes, even if they're zero return { insertions: totalInsertions, deletions: totalDeletions }; } catch { return null; @@ -444,6 +440,11 @@ function renderSingleLine(items: StatusItem[], settings: any, data: StatusJSON, if (elements.length === 0) return ''; + // Remove trailing separators + while (elements.length > 0 && elements[elements.length - 1]?.type === 'separator') { + elements.pop(); + } + // Build the final status line let statusLine = '';