notify buffer saved after closing the file descriptor

This commit is contained in:
Maxime Coste 2014-03-26 19:11:04 +00:00
parent 248e5ae6c0
commit b6e268500d

View File

@ -214,6 +214,7 @@ void write_buffer_to_file(Buffer& buffer, const String& filename)
eolformat = "\n";
auto eoldata = eolformat.data();
{
int fd = open(parse_filename(filename).c_str(),
O_CREAT | O_WRONLY | O_TRUNC, 0644);
if (fd == -1)
@ -231,6 +232,7 @@ void write_buffer_to_file(Buffer& buffer, const String& filename)
write(fd, linedata.subrange(0, linedata.size()-1), filename);
write(fd, eoldata, filename);
}
}
if ((buffer.flags() & Buffer::Flags::File) and filename == buffer.name())
buffer.notify_saved();