-
Notifications
You must be signed in to change notification settings - Fork 26
fix(parser): handle crlf sequences correctly and remove redundant checks #56
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
base: main
Are you sure you want to change the base?
fix(parser): handle crlf sequences correctly and remove redundant checks #56
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see that this modifies 4 methods line, line_fast, span, span_fast. But there's only one unit test change at a sort of higher level which deals at the line level. Can you please take a look at whether there's some unit tests that need to be added to cover this change?
I think there's probably some docs that could be updated to to capture the newline handling behavior. Would you mind updating those too?
|
(also - apologies for not getting you a response on this sooner. It's not currently added to our automatic notifications in discord so I accidentally wasn't following the repo) |
|
@joshka Looking at the code, it seems like |
|
@joshka no problem, and yes as @Cretezy mentioned, this is mainly:
I believe this is an important feature/fix since these crlf sequences are not that rare and currently "break" the conversion from ansi to ratatui in all projects depending on this one. PS: this should also marginally improve performance, which is always nice to take. |
|
@joshka added a couple of unit tests for the Is there anything else that might prevent this from being merged? |
|
I just wanted to let you know that I haven't forgotten this one. I've just been traveling a bit the last month or so. I know that digging into how this one works requires a bit more time and effort than I've had available. I'll take another look soon. |
This adds support for crlf sequences (carriage return + line feed) which weren't handled by the current implementation.
It also removes checks for a newline inside each line (which we make sure beforehand is free of any newlines anyway).