diff options
| author | Gabriel Schneider <[email protected]> | 2026-09-15 18:19:26 -0300 |
|---|---|---|
| committer | Gabriel Schneider <[email protected]> | 2026-10-01 00:12:14 -0300 |
| commit | 0b6bd969ce9982aa7c8b31c38e64034d3d949b8e (patch) | |
| tree | 8a220ac8843d0e4162a9fd5fd4edeabca1e30634 /src/locations.zig | |
| parent | af435ba7e4fd34dd5eab17bd21ce535b6f9b8413 (diff) | |
| download | pardes-0b6bd969ce9982aa7c8b31c38e64034d3d949b8e.tar.gz pardes-0b6bd969ce9982aa7c8b31c38e64034d3d949b8e.zip | |
Mark omitted source after result declaration context with ellipses
Diffstat (limited to 'src/locations.zig')
| -rw-r--r-- | src/locations.zig | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/locations.zig b/src/locations.zig index 43d99005..45d72c57 100644 --- a/src/locations.zig +++ b/src/locations.zig @@ -256,6 +256,11 @@ pub fn format(p: *pardes.Pardes, dir: []const u8, input: []const u8, anchor: ?us try out.writer.writeByte('\t'); const code_start = out.written().len - before; try out.writer.writeAll(row.code); + if (row.declaration and index + 1 < pending.items.len) { + const next = pending.items[index + 1]; + if (std.mem.eql(u8, row.path, next.path) and next.at.line -| row.at.line > 1) + try out.writer.writeAll(" ..."); + } if (index + 1 < pending.items.len or std.mem.endsWith(u8, input, "\n")) try out.writer.writeByte('\n'); const owned_path = try p.gpa.dupe(u8, row.path); errdefer p.gpa.free(owned_path); |
