From 996d8abef4d58c1d196d9b5db422b1101e583738 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 8 Jan 2018 09:42:26 +1100 Subject: [PATCH] Write new buffers even when unmodified Fixes #1794 --- src/commands.cc | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/commands.cc b/src/commands.cc index 74dd56f4..805a4234 100644 --- a/src/commands.cc +++ b/src/commands.cc @@ -357,7 +357,9 @@ void write_all_buffers(Context& context) 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)) { buffer->run_hook_in_own_context("BufWritePre", buffer->name(), context.name());