From d6bb5b5a4b4b7147762a09e04fedb91ff2ee19f3 Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Sun, 29 Jun 2014 22:03:59 +0100 Subject: [PATCH] Canonicalize filenames when checking if a buffer was written to its file --- src/file.cc | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/file.cc b/src/file.cc index 8331c596..0c13c471 100644 --- a/src/file.cc +++ b/src/file.cc @@ -233,7 +233,8 @@ void write_buffer_to_file(Buffer& buffer, StringView filename) write(fd, eoldata, filename); } } - if ((buffer.flags() & Buffer::Flags::File) and filename == buffer.name()) + if ((buffer.flags() & Buffer::Flags::File) and + real_path(filename) == real_path(buffer.name())) buffer.notify_saved(); buffer.run_hook_in_own_context("BufWritePost", buffer.name());