Julia: Incorrect alignment of nested colored output

Created on 12 Jun 2018  路  3Comments  路  Source: JuliaLang/julia

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.)

display and printing

Most helpful comment

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.

All 3 comments

One fix fix may be https://github.com/JuliaLang/julia/pull/27430. I haven鈥檛 implemented it there yet though.

This issue also applies to arrays of pairs.

array of pairs

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.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

dpsanders picture dpsanders  路  3Comments

StefanKarpinski picture StefanKarpinski  路  3Comments

i-apellaniz picture i-apellaniz  路  3Comments

wilburtownsend picture wilburtownsend  路  3Comments

TotalVerb picture TotalVerb  路  3Comments