Right align ~ marker as well

This commit is contained in:
Austen Adler 2021-05-19 20:55:31 -04:00
parent d0612095e3
commit 416cc27006

View File

@ -265,7 +265,17 @@ impl App {
.saturating_sub(stack.len() as u16)
.saturating_sub(2))
{
stack.insert(0, ListItem::new(Span::raw("~")));
stack.insert(
0,
ListItem::new(Span::raw(match self.calculator.calculator_alignment {
CalculatorAlignment::Left => String::from("~"),
CalculatorAlignment::Right => format!(
"{: >width$}",
"~",
width = (chunks[1].width as usize).saturating_sub(2)
),
})),
);
}
let stack = List::new(stack).block(Block::default().borders(Borders::ALL).title("Stack"));