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
Panic when span is on \n
in v5.4.1
#215
Comments
The previous version was able to point to the newline.
|
It also panics if the span is on EOF. |
@Benjamin-L lol are we still being cursed by the same issue? |
I also had this problem on 5.4.1 and 5.4.0. Version 5.3.0 is fine. |
Oof, yeah I didn't realize that spans that contained the EOL were previously supported. I'll have a fix for this up in a bit. While working this out, I found a few edge cases that we'll want to make sure we have good behavior for: Edge CasesCRLFsIn v5.3.0, these end up rendering like this: Source:
This seems... probably not desirable, and instead the rendered highlight should only extend one visual column past the end of line. EOFThe output for this is bad on all versions: Source:
Similar to the CRLF case, I think the rendered highlight should only extend one column past the end of line. |
@Boshen I actually wasn't able to reproduce this. When I tested v5.4.1 with a span including the EOF, I get the same bad behavior as v5.3.0, but I don't get a panic. Is this what you're seeing as well? |
Input text: "/\n"
Input span: 0..2
thread '<unnamed>' panicked at 'byte index 2 is out of bounds of
/
', /Users/boshenchen/.cargo/registry/src/github.com-1ecc6299db9ec823/miette-5.4.1/src/handlers/graphical.rs:624:21miette/src/handlers/graphical.rs
Line 624 in 3e25fd5
cc @Benjamin-L
The text was updated successfully, but these errors were encountered: