[nemiver] Fix buffer setting in SourceEditor (Closes: #633561)



commit 3514fc957462a0c1f656a7ae20e377f421606735
Author: Dodji Seketeli <dodji seketeli org>
Date:   Sun Nov 7 16:09:47 2010 +0100

    Fix buffer setting in SourceEditor (Closes: #633561)
    
    	* src/uicommon/nmv-source-editor.cc
    	(SourceEditor::Priv::SourceEditor::Priv): When initializing the
    	source editor with a null buffer, set the right context of the
    	editor with the real buffer of the source editor.

 src/uicommon/nmv-source-editor.cc |   11 ++++++++---
 1 files changed, 8 insertions(+), 3 deletions(-)
---
diff --git a/src/uicommon/nmv-source-editor.cc b/src/uicommon/nmv-source-editor.cc
index 292189d..d5f96ed 100644
--- a/src/uicommon/nmv-source-editor.cc
+++ b/src/uicommon/nmv-source-editor.cc
@@ -761,10 +761,12 @@ struct SourceEditor::Priv {
         status_box (Gtk::manage (new Gtk::HBox)),
         non_asm_ctxt (-1, -1)
     {
+        Glib::RefPtr<SourceBuffer> b;
+        b = (a_buf) ? a_buf : source_view->get_source_buffer ();
         if (a_assembly) {
-            asm_ctxt.buffer = a_buf;
+            asm_ctxt.buffer = b;
         } else {
-            non_asm_ctxt.buffer = a_buf;
+            non_asm_ctxt.buffer = b;
         }
         init ();
     }
@@ -774,8 +776,11 @@ struct SourceEditor::Priv {
         root_dir (a_root_dir),
         source_view (Gtk::manage (new SourceView (a_buf))),
         status_box (Gtk::manage (new Gtk::HBox)),
-        non_asm_ctxt (a_buf, -1, -1)
+        non_asm_ctxt (-1, -1)
     {
+        Glib::RefPtr<SourceBuffer> b;
+        b = (a_buf) ? a_buf : source_view->get_source_buffer ();
+        non_asm_ctxt.buffer = b;
         init ();
     }
 };//end class SourceEditor



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