From f592768d3ad892983819b56c1c8c16553212a70e Mon Sep 17 00:00:00 2001 From: Maxime Coste Date: Mon, 5 Feb 2018 20:18:51 +1100 Subject: [PATCH] Remove the `New` flag from a buffer after reloading it If we reload a buffer, it means its underlying file exists, hence the New flag does not make sense anymore. It could be that the file appeared on the filesystem in the meantime. --- src/buffer_utils.cc | 1 + 1 file changed, 1 insertion(+) diff --git a/src/buffer_utils.cc b/src/buffer_utils.cc index 9a5421356..1e2826954 100644 --- a/src/buffer_utils.cc +++ b/src/buffer_utils.cc @@ -86,6 +86,7 @@ void reload_file_buffer(Buffer& buffer) kak_assert(buffer.flags() & Buffer::Flags::File); MappedFile file_data{buffer.name()}; buffer.reload(file_data, file_data.st.st_mtim); + buffer.flags() &= ~Buffer::Flags::New; } Buffer* create_fifo_buffer(String name, int fd, Buffer::Flags flags, bool scroll)