| ... | ... | @@ -537,7 +537,7 @@ fn replace_variables( |
| 537 | 537 | switch (value) { |
| 538 | 538 | .boolean => |b| { |
| 539 | 539 | const buf = try std.fmt.allocPrint(allocator, "{s}{}{s}", .{ beginline, @intFromBool(b), endline }); |
| 540 | | last_index = start_index + 1; |
| 540 | last_index = prefix_index + 1; |
| 541 | 541 | |
| 542 | 542 | allocator.free(content_buf); |
| 543 | 543 | content_buf = buf; |
| ... | ... | @@ -546,14 +546,14 @@ fn replace_variables( |
| 546 | 546 | const buf = try std.fmt.allocPrint(allocator, "{s}{}{s}", .{ beginline, i, endline }); |
| 547 | 547 | const isNegative = i < 0; |
| 548 | 548 | const digits = (if (0 < i) std.math.log10(@abs(i)) else 0) + 1; |
| 549 | | last_index = start_index + @intFromBool(isNegative) + digits + 1; |
| 549 | last_index = prefix_index + @intFromBool(isNegative) + digits; |
| 550 | 550 | |
| 551 | 551 | allocator.free(content_buf); |
| 552 | 552 | content_buf = buf; |
| 553 | 553 | }, |
| 554 | 554 | .string, .ident => |x| { |
| 555 | 555 | const buf = try std.fmt.allocPrint(allocator, "{s}{s}{s}", .{ beginline, x, endline }); |
| 556 | | last_index = start_index + x.len + 1; |
| 556 | last_index = prefix_index + x.len; |
| 557 | 557 | |
| 558 | 558 | allocator.free(content_buf); |
| 559 | 559 | content_buf = buf; |
| ... | ... | @@ -561,7 +561,7 @@ fn replace_variables( |
| 561 | 561 | |
| 562 | 562 | else => { |
| 563 | 563 | const buf = try std.fmt.allocPrint(allocator, "{s}{s}", .{ beginline, endline }); |
| 564 | | last_index = start_index + 1; |
| 564 | last_index = prefix_index; |
| 565 | 565 | |
| 566 | 566 | allocator.free(content_buf); |
| 567 | 567 | content_buf = buf; |