notify buffer saved after closing the file descriptor
This commit is contained in:
parent
248e5ae6c0
commit
b6e268500d
|
@ -214,6 +214,7 @@ void write_buffer_to_file(Buffer& buffer, const String& filename)
|
||||||
eolformat = "\n";
|
eolformat = "\n";
|
||||||
auto eoldata = eolformat.data();
|
auto eoldata = eolformat.data();
|
||||||
|
|
||||||
|
{
|
||||||
int fd = open(parse_filename(filename).c_str(),
|
int fd = open(parse_filename(filename).c_str(),
|
||||||
O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
O_CREAT | O_WRONLY | O_TRUNC, 0644);
|
||||||
if (fd == -1)
|
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, linedata.subrange(0, linedata.size()-1), filename);
|
||||||
write(fd, eoldata, filename);
|
write(fd, eoldata, filename);
|
||||||
}
|
}
|
||||||
|
}
|
||||||
if ((buffer.flags() & Buffer::Flags::File) and filename == buffer.name())
|
if ((buffer.flags() & Buffer::Flags::File) and filename == buffer.name())
|
||||||
buffer.notify_saved();
|
buffer.notify_saved();
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user