From 5f5a7b53a4639c618061ee363a513487d2f684c6 Mon Sep 17 00:00:00 2001 From: Andrew Kelley Date: Mon, 5 Aug 2024 17:48:48 -0700 Subject: [PATCH] wasm zig source rendering: fix annotation location off-by-one --- lib/docs/wasm/html_render.zig | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/docs/wasm/html_render.zig b/lib/docs/wasm/html_render.zig index a406699f59cb1322854c7085d3a3e8c3244d5d14..a5211fc77f4d9e295011762109bb25f0fbc8ada5 100644 --- a/lib/docs/wasm/html_render.zig +++ b/lib/docs/wasm/html_render.zig @@ -91,7 +91,7 @@ pub fn fileSourceHtml( while (true) { if (next_annotate_index >= options.source_location_annotations.len) break; const next_annotation = options.source_location_annotations[next_annotate_index]; - if (cursor < next_annotation.file_byte_offset) break; + if (cursor <= next_annotation.file_byte_offset) break; try out.writer(gpa).print("", .{ options.annotation_prefix, next_annotation.dom_id, }); -- 2.54.0