From b9653ba05a468d3843499d8abd243158df823f82 Mon Sep 17 00:00:00 2001 From: Anthony Rodgers <51365187+adrodgers@users.noreply.github.com> Date: Thu, 19 Sep 2024 14:02:26 +0100 Subject: [PATCH] fix: prevent calender render panic when terminal height is small (#1380) Fixes: #1379 --- src/widgets/calendar.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/widgets/calendar.rs b/src/widgets/calendar.rs index 1c6d6513..2e1e49e7 100644 --- a/src/widgets/calendar.rs +++ b/src/widgets/calendar.rs @@ -177,7 +177,9 @@ impl Monthly<'_, DS> { spans.push(self.format_date(curr_day)); curr_day += Duration::DAY; } - buf.set_line(days_area.x, y, &spans.into(), area.width); + if buf.area.height > y { + buf.set_line(days_area.x, y, &spans.into(), area.width); + } y += 1; } }