Skip to content

[treeplayer] Support left-justified columns in TTree::Scan - #22951

Merged
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:issue-11786
Jul 29, 2026
Merged

[treeplayer] Support left-justified columns in TTree::Scan#22951
guitargeek merged 1 commit into
root-project:masterfrom
guitargeek:issue-11786

Conversation

@guitargeek

Copy link
Copy Markdown
Contributor

TTreePlayer::Scan documents that the "col=" format strings follow the printf specification, but the parser did not accept the '-' left-justification flag: the scan of the "col=" value stopped at the first '-', so every column from there on silently reverted to the default (right-justified) width.

Accept '-' while scanning the "col=" value, read the per-column size as a signed integer (a negative size now marks a left-justified column), and build the field-width format strings so a negative width stays valid printf: the sign drives the justification while std::abs() is used for the precision and the '*' border widths.

Closes #11786.

🤖 Done with the help of AI.

TTreePlayer::Scan documents that the "col=" format strings follow the
printf specification, but the parser did not accept the '-'
left-justification flag: the scan of the "col=" value stopped at the
first '-', so every column from there on silently reverted to the
default (right-justified) width.

Accept '-' while scanning the "col=" value, read the per-column size as
a signed integer (a negative size now marks a left-justified column),
and build the field-width format strings so a negative width stays valid
printf: the sign drives the justification while std::abs() is used for
the precision and the '*' border widths.

Closes root-project#11786.

🤖 Done with the help of AI.

@dpiparo dpiparo left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for addressing this long standing issue!

@guitargeek
guitargeek merged commit 0ed9e98 into root-project:master Jul 29, 2026
37 of 39 checks passed
@guitargeek
guitargeek deleted the issue-11786 branch July 29, 2026 06:19
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

TTreePlayer::Scan can't handle left-justified text

2 participants