fix: crash in editor_gutter.print_digits

This commit is contained in:
CJ van den Berg 2025-12-16 14:45:32 +01:00
parent f26e68b651
commit c6c310b9d0
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -446,7 +446,7 @@ fn print_digits(self: *Self, n_: anytype, style_: DigitStyle) !void {
if (n == 0) break;
}
std.mem.reverse([]const u8, digits.items);
try self.plane.cursor_move_yx(@intCast(self.plane.cursor_y()), @intCast(self.width - digits.items.len - 1));
try self.plane.cursor_move_yx(@intCast(self.plane.cursor_y()), @intCast(self.width -| digits.items.len -| 1));
for (digits.items) |digit| _ = try self.plane.putstr(digit);
}