Make color show up on the full line

This commit is contained in:
Dheepak Krishnamurthy 2020-10-23 20:02:12 -06:00
parent ef85403c56
commit f3ab0081b8
2 changed files with 2 additions and 1 deletions

View file

@ -16,7 +16,6 @@ use tui::{
};
use std::cmp::min;
use unicode_width::UnicodeWidthStr;
#[derive(Debug, Clone)]
pub struct Calendar<'a> {

View file

@ -316,8 +316,10 @@ where
x = table_area.left();
for (c, (w, elt)) in solved_widths.iter().zip(data).enumerate() {
let s = if c == 0 {
buf.set_stringn(x, y + i as u16, format!("{symbol:^width$}", symbol="", width=area.width as usize), *w as usize, style);
format!("{}{}", symbol, elt)
} else {
buf.set_stringn(x - 1, y + i as u16, format!("{symbol:^width$}", symbol="", width=area.width as usize), *w as usize + 1, style);
format!("{}", elt)
};
buf.set_stringn(x, y + i as u16, s, *w as usize, style);