Use the general code path for reload info box handling in Client

This commit is contained in:
Maxime Coste 2016-03-02 13:14:21 +00:00
parent 13d039c228
commit 068ca08b4c

View File

@ -276,12 +276,11 @@ void Client::check_if_buffer_needs_reloading()
return; return;
if (reload == Autoreload::Ask) if (reload == Autoreload::Ask)
{ {
m_ui->info_show( StringView bufname = buffer.display_name();
format("reload '{}' ?", buffer.display_name()), info_show(format("reload '{}' ?", bufname),
format("'{}' was modified externally\n" format("'{}' was modified externally\n"
"press <ret> or y to reload, <esc> or n to keep", "press <ret> or y to reload, <esc> or n to keep",
buffer.display_name()), bufname), {}, InfoStyle::Prompt);
CharCoord{}, get_face("Information"), InfoStyle::Prompt);
m_buffer_reload_dialog_opened = true; m_buffer_reload_dialog_opened = true;
m_input_handler.on_next_key(KeymapMode::None, [this](Key key, Context&){ on_buffer_reload_key(key); }); m_input_handler.on_next_key(KeymapMode::None, [this](Key key, Context&){ on_buffer_reload_key(key); });