You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hello, thanks for your amazing work on this crate!
I recently encountered a problem while trying to annotate Unix line feeds (\n). When annotating line feeds with an empty Range, I got the following error:
error: bad
--> test.txt:1:1
|
|
This looks like a bug because doing the same thing on letters or digits works as expected:
error: bad
--> test.txt:1:1
|
1 | 111
| ^
|
Also, giving a non-empty Range solves the problem and outputs the annotation as expected:
error: bad
--> test.txt:1:1
|
1 | ...
| ^
|
Here is the code used to reproduce the problem (which occurs with the latest release). test.txt is a simple text file containing only Unix line feeds (\n):
use annotate_snippets::{Level,Renderer,Snippet};pubfnreproduce_bug(){let renderer = Renderer::styled();let message = Level::Error.title("bad").snippet(Snippet::source(include_str!("../test.txt")).origin("test.txt").fold(true).annotation(Level::Error.span(0..0)),);
anstream::println!("{}", renderer.render(message));}
The text was updated successfully, but these errors were encountered:
Hello, thanks for your amazing work on this crate!
I recently encountered a problem while trying to annotate Unix line feeds (
\n
). When annotating line feeds with an emptyRange
, I got the following error:This looks like a bug because doing the same thing on letters or digits works as expected:
Also, giving a non-empty
Range
solves the problem and outputs the annotation as expected:Here is the code used to reproduce the problem (which occurs with the latest release).
test.txt
is a simple text file containing only Unix line feeds (\n
):The text was updated successfully, but these errors were encountered: