From 49ea6f71031b916245aa099c5d5d24b48d85cc12 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 15 Jan 2012 01:45:23 +0000 Subject: [PATCH] correctly clear the window status line --- src/main.cc | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/src/main.cc b/src/main.cc index 069ef006..74cec3ba 100644 --- a/src/main.cc +++ b/src/main.cc @@ -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);