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] Console.print skip the empty lines in the beginning for Syntax #1214

Closed
gaogaotiantian opened this issue May 5, 2021 · 1 comment · Fixed by #1215
Closed

[BUG] Console.print skip the empty lines in the beginning for Syntax #1214

gaogaotiantian opened this issue May 5, 2021 · 1 comment · Fixed by #1215
Labels
bug Something isn't working

Comments

@gaogaotiantian
Copy link

Describe the bug

When I try to print a Syntax with Console, it skips the empty lines in the beginning. Not sure if it's on purpose, but it messed up with the line numbers, which I think is bad. Take the following code as an example:

syn = Syntax("\n\na=3", "python", line_numbers=True)
c = Console()
c.print(syn)

It will show line number 1 for a=3, which is incorrect. This is especially annoying when you try to display source code from a certain line number and that line happens to be empty.

I'm running this on WSL, but I would guess this should be easily reproducible on any platform.

@willmcgugan willmcgugan added bug Something isn't working and removed Needs triage labels May 6, 2021
@willmcgugan
Copy link
Collaborator

Will have a fix for that in the next version.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants