Skip to content

Fix #354: a header that fits in maxcolwidths must not widen the column - #461

Open
422949798 wants to merge 1 commit into
astanin:masterfrom
422949798:fix-354-header-width
Open

422949798 wants to merge 1 commit into
astanin:masterfrom
422949798:fix-354-header-width

Conversation

@422949798

Copy link
Copy Markdown

Fixes #354.

What was wrong

A header that already fits inside an explicit maxcolwidths limit still pushed the column
past that limit: the header-driven minimum column width is width(header) + MIN_PADDING
and was never compared with the limit. With maxcolwidths=[None, None, 8] and an
8-character header the cell was rendered 12 wide (content 10) instead of 10 (content 8) —
two extra characters per affected column, enough to overflow a terminal when
maxcolwidths is derived from the terminal width.

Minimal reproduction

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

maxcolwidths isn't properly respected: extra whitespace is added

1 participant