Fix dangling separators. Fix empty git status.

This commit is contained in:
Matthew Breedlove
2025-08-08 21:50:58 -04:00
parent cfb0ad0478
commit d3d5c30ea8
+6 -5
View File
@@ -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 = '';