Reset normal mode before hiding the reload buffer info box

Reseting normal mode will enable normal mode, which will trigger
a check for buffer modification. We do not want that check to
happen as we are trying to close the info box. Doing that mode
reset first will prevent the check from happening (as the info
box is already displayed), and will correctly hide it afterwards.

Fixes #1809
This commit is contained in:
Maxime Coste 2018-01-26 13:45:36 +11:00
parent 29a7cd3ab4
commit bf73cb0109

View File

@ -311,9 +311,10 @@ void Client::on_buffer_reload_key(Key key)
void Client::close_buffer_reload_dialog() void Client::close_buffer_reload_dialog()
{ {
kak_assert(m_buffer_reload_dialog_opened); kak_assert(m_buffer_reload_dialog_opened);
// Reset first as this might check for reloading.
m_input_handler.reset_normal_mode();
m_buffer_reload_dialog_opened = false; m_buffer_reload_dialog_opened = false;
info_hide(true); info_hide(true);
m_input_handler.reset_normal_mode();
} }
void Client::check_if_buffer_needs_reloading() void Client::check_if_buffer_needs_reloading()