2
0
mirror of https://github.com/xvxx/phetch synced 2024-11-12 13:10:40 +00:00

clear empty status line

This commit is contained in:
dvkt 2020-01-02 11:52:29 -08:00
parent 16e12b6c57
commit 5a78ca16c1

View File

@ -77,13 +77,22 @@ impl UI {
termion::cursor::Hide,
screen,
);
if status.len() > 0 {
if status.is_empty() {
write!(
out,
"{}{}{}",
termion::cursor::Goto(1, self.rows()),
termion::cursor::Hide,
termion::clear::CurrentLine,
);
} else {
write!(
out,
"{}{}{}{}",
termion::cursor::Goto(1, self.rows()),
status,
termion::cursor::Show,
termion::cursor::Hide,
termion::clear::UntilNewline,
);
}
out.flush();