I noticed in my Lua linter, that the highlighting of patches is wrong, if the code is indented. It works correctly if the code is not indented.
do
local function f()
print()
end
end
Here is a minimal reproducer.
use annotate_snippets::{Group, Level, Patch, Renderer, Snippet};
fn main() {
let source = "do\n local function f()\n print()\n end\nend\n";
let delete_span = 5..41;
let group = Group::with_title(Level::HELP.secondary_title("delete the definition"))
.element(Snippet::source(source).patch(Patch::new(delete_span, "")));
let renderer = Renderer::styled();
println!("{}", renderer.render(&[group]));
}
I noticed in my Lua linter, that the highlighting of patches is wrong, if the code is indented. It works correctly if the code is not indented.
Here is a minimal reproducer.