mirror of
https://github.com/ratatui-org/ratatui
synced 2024-11-13 00:17:11 +00:00
fix: prevent calender render panic when terminal height is small (#1380)
Fixes: #1379
This commit is contained in:
parent
9875d9facc
commit
b9653ba05a
1 changed files with 3 additions and 1 deletions
|
@ -177,7 +177,9 @@ impl<DS: DateStyler> Monthly<'_, DS> {
|
||||||
spans.push(self.format_date(curr_day));
|
spans.push(self.format_date(curr_day));
|
||||||
curr_day += Duration::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;
|
y += 1;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue