Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Incorrect alignment of nested colored output #27540

Closed
HarrisonGrodin opened this issue Jun 12, 2018 · 4 comments
Closed

Incorrect alignment of nested colored output #27540

HarrisonGrodin opened this issue Jun 12, 2018 · 4 comments
Labels
display and printing Aesthetics and correctness of printed representations of objects.

Comments

@HarrisonGrodin
Copy link
Contributor

When calculating the maximum width for an expression, the show function for AbstractDict fails to take into account the fact that ANSI formatting codes do not take up character space. Thus, the output of other pairs within an AbstractDict can appear to be shifted unnecessarily.

Additionally, when shortening output to fit the screen, the ANSI codes are sometimes be split apart, showing strange filler characters and recoloring the arrow => and remaining output based on the previously-set color.

screenshot

(Note: produced within an xterm-256color terminal.)

@JeffBezanson JeffBezanson added the display and printing Aesthetics and correctness of printed representations of objects. label Jun 12, 2018
@vtjnash
Copy link
Member

vtjnash commented Jun 12, 2018

One fix fix may be #27430. I haven’t implemented it there yet though.

vtjnash added a commit that referenced this issue Jun 22, 2018
@HarrisonGrodin
Copy link
Contributor Author

This issue also applies to arrays of pairs.

array of pairs

@HarrisonGrodin HarrisonGrodin changed the title Incorrect handling of colored output in AbstractDict showing Incorrect handling of colored output when showing aligned pairs Jun 23, 2018
@vtjnash
Copy link
Member

vtjnash commented Jun 23, 2018

Not just limited to that either, an Matrix has the same issue:
image

In #27430, I've got this printing correctly for Dict now. The matrix code is more complex, so I'm only partway done with fixing it there.

@HarrisonGrodin HarrisonGrodin changed the title Incorrect handling of colored output when showing aligned pairs Incorrect alignment of nested colored output Jun 23, 2018
vtjnash added a commit that referenced this issue Jun 23, 2018
vtjnash added a commit that referenced this issue Jun 23, 2018
vtjnash added a commit to vtjnash/julia that referenced this issue Jul 2, 2018
@laborg
Copy link
Contributor

laborg commented Oct 17, 2023

Fixed by
#45521
#37568

@laborg laborg closed this as completed Oct 17, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
display and printing Aesthetics and correctness of printed representations of objects.
Projects
None yet
Development

No branches or pull requests

4 participants