diff --git a/src/client.cc b/src/client.cc index d41a1ba9..7389b224 100644 --- a/src/client.cc +++ b/src/client.cc @@ -179,9 +179,9 @@ void Client::change_buffer(Buffer& buffer) context().selections_write_only() = std::move(ws.selections); context().set_window(*m_window); m_window->set_dimensions(m_ui->dimensions()); - force_redraw(); m_window->hooks().run_hook("WinDisplay", buffer.name(), context()); + force_redraw(); } static bool is_inline(InfoStyle style) diff --git a/src/context.cc b/src/context.cc index 8d225052..09d1d4d5 100644 --- a/src/context.cc +++ b/src/context.cc @@ -148,18 +148,19 @@ void Context::change_buffer(Buffer& buffer) if (m_edition_level > 0) this->buffer().commit_undo_group(); - m_window.reset(); - if (has_client()) - { - client().change_buffer(buffer); - client().info_hide(); - client().menu_hide(); - } - else - m_selections = SelectionList{buffer, Selection{}}; if (has_input_handler()) input_handler().reset_normal_mode(); + + m_window.reset(); + if (has_client()) + { + client().info_hide(); + client().menu_hide(); + client().change_buffer(buffer); + } + else + m_selections = SelectionList{buffer, Selection{}}; } SelectionList& Context::selections()