on resize, set the terminal cursor to max

This commit is contained in:
Mitchell Hashimoto
2022-05-23 15:25:22 -07:00
parent b9c93b9017
commit a7e0bb04ea

View File

@ -102,6 +102,10 @@ pub fn resize(self: *Terminal, alloc: Allocator, cols: usize, rows: usize) !void
.top = 0, .top = 0,
.bottom = rows - 1, .bottom = rows - 1,
}; };
// Move our cursor
self.cursor.x = @minimum(self.cursor.x, self.cols - 1);
self.cursor.y = @minimum(self.cursor.y, self.rows - 1);
} }
/// Return the current string value of the terminal. Newlines are /// Return the current string value of the terminal. Newlines are