correctly clear the window status line

This commit is contained in:
Maxime Coste 2012-01-15 01:45:23 +00:00
parent 4a5758ebb3
commit 49ea6f7103

View File

@ -147,9 +147,12 @@ void draw_window(Window& window)
set_color(Color::Cyan, Color::Black);
std::string status_line = window.status_line();
move(max_y, max_x - status_line.length());
static int last_status_length = 0;
move(max_y, max_x - last_status_length);
clrtoeol();
move(max_y, max_x - status_line.length());
addstr(status_line.c_str());
last_status_length = status_line.length();
const DisplayCoord& cursor_position = window.cursor_position();
move(cursor_position.line, cursor_position.column);