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
I recently discovered an issue while using annotate_snippets version 0.11.3 with the following code:
let message = Level::Error.title("dummy").snippet(Snippet::source(r"foobarbaz ",).fold(true).annotation(Level::Error.span(4..11)),);let renderer = Renderer::styled();
anstream::println!("{}", renderer.render(message));
test.txt
foo
bar
baz
The problem is that when a span starts with a line feed (\n), the entire following line isn't annotated and is sort of ignored. We can clearly see in the output below that the annotation is somehow truncated. While this isn't a blocking problem for us, we wanted to share our finding as this looks like a bug.
Hello,
Thanks for all your work on this project!
Problem
I recently discovered an issue while using
annotate_snippets
version0.11.3
with the following code:test.txt
The problem is that when a span starts with a line feed (
\n
), the entire following line isn't annotated and is sort of ignored. We can clearly see in the output below that the annotation is somehow truncated. While this isn't a blocking problem for us, we wanted to share our finding as this looks like a bug.Actual output
This code produces the following output:
Expected output
We can get the following output by moving the annotation's span to the previous byte (
3..11
).Thanks for your time!
The text was updated successfully, but these errors were encountered: