AnsiTextCell overwrites following cells when `show_row_number` is set
staticfloat opened this issue · comments
Elliot Saba commented
Example:
julia> using PrettyTables
table = Dict(
:x => ["totally not an a"],
:xx => [AnsiTextCell("a")],
)
pretty_table(stdout, table; show_row_number = true)
┌─────┬──────────────┬──────────────────┐
│ Row │ xx │ x │
│ │ AnsiTextCell │ String │
├─────┼──────────────┼──────────────────┤
│ 1 │ a │ a │
└─────┴──────────────┴──────────────────┘
Note how the second cell should not say a
, it should say totally not an a
. Also note how this is somewhat Dict
-key-ordering-sensitive; if the AnsiTextCell
comes as the last column, everything looks fine:
julia> using PrettyTables
table = Dict(
:xx => ["totally not an a"],
:x => AnsiTextCell[AnsiTextCell("a")],
)
pretty_table(stdout, table; show_row_number = true)
┌─────┬──────────────────┬──────────────┐
│ Row │ xx │ x │
│ │ String │ AnsiTextCell │
├─────┼──────────────────┼──────────────┤
│ 1 │ totally not an a │ a │
└─────┴──────────────────┴──────────────┘
Ronan Arraes Jardim Chagas commented
Ops! I missed that notification. Thanks @staticfloat, let me see what's happening here.
Ronan Arraes Jardim Chagas commented
Done! I was a regression due to the last commit. The problem is that I have three types of indices:
- The index of the data in the original table.
- The index of the data in the processed table (with additional columns).
- The index of the data in the string table considering the cropping.
I always get confused with those things :)
Thank you very much for the report.
Elliot Saba commented
Awesome! I really appreciate how quick you are to deal with these reports, thank you!