Skip to content

Commit 463c60f

Browse files
author
secooond
committed
fix(commitments): reserve 3 chars for ellipsis in truncate()
truncate() reserved maxChars-1 for a single-char ellipsis but appended the three-character '...', causing truncated values to overflow by 2 characters. This broke fixed-width padEnd() column alignment in the commitments table. Change maxChars-1 to maxChars-3 to match the actual ellipsis width. Closes #95921.
1 parent 7626ca3 commit 463c60f

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

‎src/commands/commitments.ts‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -24,7 +24,7 @@ const STATUS_VALUES = new Set<CommitmentStatus>([
2424
]);
2525

2626
function truncate(value: string, maxChars: number): string {
27-
return value.length <= maxChars ? value : `${value.slice(0, maxChars - 1)}...`;
27+
return value.length <= maxChars ? value : `${value.slice(0, maxChars - 3)}...`;
2828
}
2929

3030
function safe(value: string): string {

0 commit comments

Comments
 (0)