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