diff --git a/src/client.cc b/src/client.cc index a7d3b59aa..6de433b9f 100644 --- a/src/client.cc +++ b/src/client.cc @@ -173,10 +173,15 @@ void Client::reload_buffer() { auto& buffer = context().buffer(); kak_assert(buffer.flags() & Buffer::Flags::File); - Buffer* buf = create_buffer_from_file(buffer.name()); - kak_assert(buf == &buffer); - context().print_status({ format("'{}' reloaded", buffer.display_name()), - get_face("Information") }); + if (Buffer* buf = create_buffer_from_file(buffer.name())) + { + kak_assert(buf == &buffer); + context().print_status({ format("'{}' reloaded", buffer.display_name()), + get_face("Information") }); + } + else + context().print_status({ format("could not reload '{}'", buffer.display_name()), + get_face("Error") }); } void Client::on_buffer_reload_key(Key key)