diff options
| author | Maxime Coste <frrrwww@gmail.com> | 2014-08-12 19:19:46 +0100 |
|---|---|---|
| committer | Maxime Coste <frrrwww@gmail.com> | 2014-08-12 19:19:46 +0100 |
| commit | e2b3dd0ca4b71fd7cfcceeba35b97497631e72bd (patch) | |
| tree | f64929c9dbaef3a0260781b8dd82a7c4dec7bef3 /src | |
| parent | d356ae241986282cf33a31874da1d3139960b63d (diff) | |
Tweak client redraw logic, avoid highlight if only status line changed
Diffstat (limited to 'src')
| -rw-r--r-- | src/client.cc | 8 | ||||
| -rw-r--r-- | src/client.hh | 1 |
2 files changed, 6 insertions, 3 deletions
diff --git a/src/client.cc b/src/client.cc index c3218b77..d40791b5 100644 --- a/src/client.cc +++ b/src/client.cc @@ -42,8 +42,7 @@ void Client::handle_available_input() void Client::print_status(DisplayLine status_line) { - m_status_line = std::move(status_line); - context().window().forget_timestamp(); + m_pending_status_line = std::move(status_line); } DisplayLine Client::generate_mode_line() const @@ -92,7 +91,9 @@ void Client::redraw_ifn() { DisplayLine mode_line = generate_mode_line(); const bool buffer_changed = context().window().timestamp() != context().buffer().timestamp(); - if (buffer_changed or mode_line.atoms() != m_mode_line.atoms()) + const bool mode_line_changed = mode_line.atoms() != m_mode_line.atoms(); + const bool status_line_changed = m_status_line.atoms() != m_pending_status_line.atoms(); + if (buffer_changed or status_line_changed or mode_line_changed) { if (buffer_changed) { @@ -103,6 +104,7 @@ void Client::redraw_ifn() context().window().update_display_buffer(context()); } m_mode_line = std::move(mode_line); + m_status_line = m_pending_status_line; context().ui().draw(context().window().display_buffer(), m_status_line, m_mode_line); } diff --git a/src/client.hh b/src/client.hh index 3f8ee4b6..66472808 100644 --- a/src/client.hh +++ b/src/client.hh @@ -54,6 +54,7 @@ private: InputHandler m_input_handler; DisplayLine m_status_line; + DisplayLine m_pending_status_line; DisplayLine m_mode_line; }; |
