Commit 86f4f43d authored by Fabien Parent's avatar Fabien Parent
Browse files

fix the CTRL+Z on a just opened buffer.

parent 1e61b5ac
......@@ -47,6 +47,7 @@ Glib::RefPtr<FileBuffer> load_iochannel(const Glib::RefPtr<Glib::IOChannel>& inp
const Util::ScopedArray<char> inbuf (new char[BUFSIZE]);
gsize bytes_read = 0;
text_buffer->begin_not_undoable_action();
while (input->read(inbuf.get(), BUFSIZE, bytes_read) == Glib::IO_STATUS_NORMAL)
{
if (std::memchr(inbuf.get(), '\0', bytes_read)) // binary file?
......@@ -54,6 +55,7 @@ Glib::RefPtr<FileBuffer> load_iochannel(const Glib::RefPtr<Glib::IOChannel>& inp
text_end = text_buffer->insert(text_end, inbuf.get(), inbuf.get() + bytes_read);
}
text_buffer->end_not_undoable_action();
g_assert(bytes_read == 0);
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment