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

How to reset Style? Weird bug with Style.Empty #548

Open
nau opened this issue Jun 18, 2023 · 1 comment
Open

How to reset Style? Weird bug with Style.Empty #548

nau opened this issue Jun 18, 2023 · 1 comment

Comments

@nau
Copy link

nau commented Jun 18, 2023

I pretty print my Doc using .style(Style.XTerm.Fg.colorCode(..) to show it in a terminal.
Now I want to render it to a file without styles.
How to property do that?

I tried pretty.style(Style.Empty).render(100) but this results in NPE.
println(Style.Empty.start) outputs null for some weird reason.
Scala 3.3.0, paiges 0.4.2, OpenJDK 11.0.15.

Any ideas?

@johnynek
Copy link
Collaborator

Sorry, I just saw this. I'm about to publish a new version with scala 3.3.0 support. Let's try that.

As far as suggestions, I would say let's see if we can replicate this in a test (if you send a PR with a failing test, that would be very helpful).

It goes without saying that the library should never fail with NPE.

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

No branches or pull requests

2 participants