mirror of
https://github.com/tiennm99/ccstatusline.git
synced 2026-10-12 20:15:40 +00:00
Fix dangling separators. Fix empty git status.
This commit is contained in:
1 parent
cfb0ad0478
commit
d3d5c30ea8
1 file changed
+6
-5
+6
-5
@@ -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 = '';
|
||||
|
||||
|
||||
Reference in new issue
Block a user