summaryrefslogtreecommitdiff
path: root/core/hunks.zig
diff options
context:
space:
mode:
Diffstat (limited to 'core/hunks.zig')
-rw-r--r--core/hunks.zig6
1 files changed, 4 insertions, 2 deletions
diff --git a/core/hunks.zig b/core/hunks.zig
index d8c5e2de..bdebc34d 100644
--- a/core/hunks.zig
+++ b/core/hunks.zig
@@ -15,6 +15,7 @@ const std = @import("std");
const diff = @import("diff.zig");
const syntax = @import("syntax.zig");
const locations = @import("locations.zig");
+const look = @import("look.zig");
const pardes = @import("root.zig");
const Pardes = pardes.Pardes;
@@ -385,7 +386,7 @@ fn flush(ctx: *const Ctx, out: *Out, hunk: *Hunk, memo: *SourceMemo, scratch: *[
var row = declaration.start_line;
while (row <= declaration.header_end_line and row < start_row) : (row += 1) {
if (row == declaration.start_line and ctx.tslocations) {
- const label = try std.fmt.allocPrint(arena, "{s}:{d}", .{ shown, row + 1 });
+ const label = try std.fmt.allocPrint(arena, "{f}:{d}", .{ look.quoted(shown), row + 1 });
try out.row(arena, label, .{ .kind = .declaration, .path = shown, .line = row + 1, .location_end = label.len, .code_start = label.len });
}
// A blank where a hunk line has its marker: the code aligns.
@@ -396,7 +397,8 @@ fn flush(ctx: *const Ctx, out: *Out, hunk: *Hunk, memo: *SourceMemo, scratch: *[
// The hunk's label: a step for n and N, and a look's place.
const line_no = change_row + 1;
var label: std.Io.Writer.Allocating = .init(arena);
- try label.writer.print("{s}:{d}", .{ shown, line_no });
+ // The name as a row writes it (look.quoted): a `:` in it never splits it.
+ try label.writer.print("{f}:{d}", .{ look.quoted(shown), line_no });
const location_end = label.written().len;
if (depth > 0) {
try label.writer.writeByte(' ');