fix: minor off-by-one bug in View.is_visible

This commit is contained in:
CJ van den Berg 2025-08-25 21:32:58 +02:00
parent 6ac8ecd2f0
commit 76ef0aff3a
Signed by: neurocyte
GPG key ID: 8EB1E1BB660E3FB9

View file

@ -67,8 +67,9 @@ inline fn is_at_bottom(self: *const Self, root: Buffer.Root) bool {
}
pub inline fn is_visible(self: *const Self, cursor: *const Cursor) bool {
if (self.rows == 0) return false;
const row_min = self.row;
const row_max = row_min + self.rows;
const row_max = row_min + self.rows - 1;
const col_min = self.col;
const col_max = col_min + self.cols;
return row_min <= cursor.row and cursor.row <= row_max and