fix: Make absolute Plane writing functions update column correctly

Writing to an absolute plane position should update the plane's cursor
position before incrementing it even if it is not actually used.

closes #446
This commit is contained in:
CJ van den Berg 2026-01-13 10:35:39 +01:00
parent b52091fe34
commit 35be98f95c
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -138,6 +138,7 @@ pub fn fill(self: *Plane, egc: []const u8) void {
for (0..self.dim_y()) |y| for (0..self.dim_y()) |y|
for (0..self.dim_x()) |x| for (0..self.dim_x()) |x|
self.write_cell(x, y, egc); self.write_cell(x, y, egc);
if (self.col > 100000) std.log.debug("column: {}", .{self.col});
} }
pub fn fill_width(self: *Plane, comptime fmt: anytype, args: anytype) !usize { pub fn fill_width(self: *Plane, comptime fmt: anytype, args: anytype) !usize {
@ -261,6 +262,8 @@ fn write_cell(self: *Plane, col: usize, row: usize, egc: []const u8) void {
cell.style = self.style; cell.style = self.style;
} }
self.window.writeCell(@intCast(col), @intCast(row), cell); self.window.writeCell(@intCast(col), @intCast(row), cell);
self.row = @intCast(row);
self.col = @intCast(col);
self.col += @intCast(w); self.col += @intCast(w);
} }