fix: broken cursor movement in cursor_move_yx causes info view to miss render

This commit is contained in:
CJ van den Berg 2026-01-13 16:17:15 +01:00
parent cf28e27a81
commit 52dfc1e706
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -280,14 +280,14 @@ pub fn cursor_x(self: Plane) i32 {
return self.col; return self.col;
} }
pub fn cursor_move_yx(self: *Plane, y: i32, x: i32) !void { pub fn cursor_move_yx(self: *Plane, y: i32, x: i32) error{}!void {
if (self.window.height == 0 or self.window.width == 0) return; if (self.window.height == 0 or self.window.width == 0) return;
if (self.window.height <= y or self.window.width <= x) return; if (self.window.height <= y or self.window.width <= x) return;
self.row = y; if (y >= 0) self.row = y;
self.col = x; if (x >= 0) self.col = x;
} }
pub fn cursor_move_rel(self: *Plane, y: i32, x: i32) !void { pub fn cursor_move_rel(self: *Plane, y: i32, x: i32) error{OutOfBounds}!void {
if (self.window.height == 0 or self.window.width == 0) return error.OutOfBounds; if (self.window.height == 0 or self.window.width == 0) return error.OutOfBounds;
const new_y = self.row + y; const new_y = self.row + y;
const new_x = self.col + x; const new_x = self.col + x;