term: Don't print empty tables

Before this change, the table borders would be printed, as well as the
table header if any.
This commit is contained in:
cloudhead 2024-06-08 21:21:14 +02:00
parent 6966c97194
commit d9fa83f9da
No known key found for this signature in database
1 changed files with 5 additions and 0 deletions

View File

@ -92,6 +92,11 @@ where
let inner = self.inner(parent);
let cols = inner.cols;
// Don't print empty tables.
if self.is_empty() {
return lines;
}
if let Some(color) = border {
lines.push(
Line::default()