Skip to content

Conversation

@mcabbott
Copy link
Contributor

@mcabbott mcabbott commented Nov 2, 2022

Follow-up to #45751

Uses ANSIIterator from #45521 so that the printing of structured matrices isn't thrown off by the presence of invisible colour codes.

@KristofferC KristofferC added the backport 1.8 Change should be backported to release-1.8 label Nov 2, 2022
@jariji
Copy link
Contributor

jariji commented Nov 2, 2022

@KristofferC KristofferC merged commit 9f572b6 into JuliaLang:master Nov 3, 2022
@mcabbott mcabbott deleted the patch-3 branch November 3, 2022 13:23
@KristofferC KristofferC mentioned this pull request Nov 8, 2022
26 tasks
KristofferC pushed a commit that referenced this pull request Dec 14, 2022
KristofferC pushed a commit that referenced this pull request Dec 14, 2022
KristofferC pushed a commit that referenced this pull request Dec 14, 2022
@KristofferC KristofferC removed the backport 1.8 Change should be backported to release-1.8 label Dec 14, 2022
jishnub pushed a commit to JuliaArrays/BlockArrays.jl that referenced this pull request Jan 12, 2025
Previously, BlockArrays with elements that used styling would throw off
the printing, because the textwidth computation didn't account for the
fact that some contents might have a different `length` relative to how
much space they take up when printed.

This fixes that by using the `ANSIIterator` from Base, ala
JuliaLang/julia#47430. Unfortunately,
`ANSIIterator` isn't exported at the moment - but the alternative is to
depend on StringManipulations.jl or copy over the Base implementation.

I added a test that shows the problem. Previously, it displayed as:

![image](https://github.com/user-attachments/assets/722037b0-aeb1-4aca-b8aa-2c603290cf02)
With this, it displays as:

![image](https://github.com/user-attachments/assets/a0d5098d-8d5a-4019-a733-2a1acbcdaa4a)
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.

3 participants