From 5a78ca16c16bb08f8a505a49ee27e78965e96922 Mon Sep 17 00:00:00 2001 From: dvkt Date: Thu, 2 Jan 2020 11:52:29 -0800 Subject: [PATCH] clear empty status line --- src/ui.rs | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/ui.rs b/src/ui.rs index e94dbe4..9ed494d 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -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();