[regexxer] fix the CTRL+Z on a just opened buffer.



commit 86f4f43d445d346d27156f020a836cdf2ae122f1
Author: Fabien Parent <parent f gmail com>
Date:   Thu Sep 24 21:05:36 2009 +0200

    fix the CTRL+Z on a just opened buffer.

 src/fileio.cc |    2 ++
 1 files changed, 2 insertions(+), 0 deletions(-)
---
diff --git a/src/fileio.cc b/src/fileio.cc
index ada4d4f..563abb2 100644
--- a/src/fileio.cc
+++ b/src/fileio.cc
@@ -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);
 



[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]