Write new buffers even when unmodified

Fixes #1794
This commit is contained in:
Maxime Coste 2018-01-08 09:42:26 +11:00
parent baf3d82b34
commit 996d8abef4

View File

@ -357,7 +357,9 @@ void write_all_buffers(Context& context)
for (auto& buffer : buffers) for (auto& buffer : buffers)
{ {
if ((buffer->flags() & Buffer::Flags::File) and buffer->is_modified() if ((buffer->flags() & Buffer::Flags::File) and
((buffer->flags() & Buffer::Flags::New) or
buffer->is_modified())
and !(buffer->flags() & Buffer::Flags::ReadOnly)) and !(buffer->flags() & Buffer::Flags::ReadOnly))
{ {
buffer->run_hook_in_own_context("BufWritePre", buffer->name(), context.name()); buffer->run_hook_in_own_context("BufWritePre", buffer->name(), context.name());