mirror of
https://github.com/tiennm99/ccstatusline.git
synced 2026-10-20 02:17:03 +00:00
Minor bug fix for padding
This commit is contained in:
1 parent
e0012bc0eb
commit
a69a6997d0
2 files changed
+9
-3
No files matched your search
+2
-1
@@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ccstatusline",
|
"name": "ccstatusline",
|
||||||
"version": "1.1.5",
|
"version": "1.1.6",
|
||||||
"description": "A customizable status line formatter for Claude Code CLI",
|
"description": "A customizable status line formatter for Claude Code CLI",
|
||||||
"module": "src/ccstatusline.ts",
|
"module": "src/ccstatusline.ts",
|
||||||
"type": "module",
|
"type": "module",
|
||||||
@@ -12,6 +12,7 @@
|
|||||||
],
|
],
|
||||||
"scripts": {
|
"scripts": {
|
||||||
"start": "bun run patch && bun run src/ccstatusline.ts",
|
"start": "bun run patch && bun run src/ccstatusline.ts",
|
||||||
|
"statusline": "bun run src/ccstatusline.ts",
|
||||||
"patch": "patch-package",
|
"patch": "patch-package",
|
||||||
"build": "bun run patch && rm -rf dist/* && bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
|
"build": "bun run patch && rm -rf dist/* && bun build src/ccstatusline.ts --target=node --outfile=dist/ccstatusline.js --target-version=14",
|
||||||
"prepublishOnly": "bun run build"
|
"prepublishOnly": "bun run build"
|
||||||
|
|||||||
@@ -718,9 +718,14 @@ export function renderStatusLine(
|
|||||||
elem.content +
|
elem.content +
|
||||||
applyColorsWithOverride(padding, undefined, elem.item?.backgroundColor);
|
applyColorsWithOverride(padding, undefined, elem.item?.backgroundColor);
|
||||||
finalElements.push(paddedContent);
|
finalElements.push(paddedContent);
|
||||||
|
} else if (padding) {
|
||||||
|
// Wrap padding in ANSI reset codes to prevent trimming
|
||||||
|
// This ensures leading spaces aren't trimmed by terminals
|
||||||
|
const protectedPadding = chalk.reset(padding);
|
||||||
|
finalElements.push(protectedPadding + elem.content + protectedPadding);
|
||||||
} else {
|
} else {
|
||||||
// No colors or no padding
|
// No padding
|
||||||
finalElements.push(padding + elem.content + padding);
|
finalElements.push(elem.content);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
});
|
});
|
||||||
|
|||||||
Reference in new issue
Block a user