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

[BUG] soft_wrap does nothing when printing a Syntax object to console #3304

Closed
2 tasks
awgymer opened this issue Mar 19, 2024 · 4 comments
Closed
2 tasks

[BUG] soft_wrap does nothing when printing a Syntax object to console #3304

awgymer opened this issue Mar 19, 2024 · 4 comments

Comments

@awgymer
Copy link

awgymer commented Mar 19, 2024

Describe the bug

I am trying to print some formatted/highlighted markdown to console with a Syntax object but it always crops the end of long lines, regardless of my settings.

Screenshot 2024-03-19 at 10 51 35 am

Platform

Click to expand

Mac OS 13.5
Using terminal app with zsh
Python 3.11
rich 13.6

Copy link

We found the following entry in the FAQ which you may find helpful:

Feel free to close this issue if you found an answer in the FAQ. Otherwise, please give us a little time to review.

This is an automated reply, generated by FAQtory

@willmcgugan
Copy link
Collaborator

You can set word_wrap=True on the Syntax class.

@awgymer
Copy link
Author

awgymer commented Mar 19, 2024

This does not fix the issue:
Screenshot 2024-03-19 at 11 53 27 am

EDIT: Turns out you need to then disable soft_wrap on the print call!

Screenshot 2024-03-19 at 11 55 19 am

That interplay is a little bit unexpected to me but hey ho

Copy link

I hope we solved your problem.

If you like using Rich, you might also enjoy Textual

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants