src/Builder4/WindowRooView.bjs
[app.Builder.js] / src / Builder4 / WindowRooView.vala
index a6ca405..df1be95 100644 (file)
@@ -1207,12 +1207,14 @@ public class Xcls_WindowRooView : Object
             
             // get the cursor and scroll position....
             var buf = this.el.get_buffer();
-               var cpos =   buf.cursor_position;
+               var cpos = buf.cursor_position;
+            
+        
            
             var vadj = this.el.get_vadjustment();
            
             
-            var buf = this.el.get_buffer();
+         
             buf.set_text("",0);
             var sbuf = (Gtk.SourceBuffer) buf;
         
@@ -1243,9 +1245,17 @@ public class Xcls_WindowRooView : Object
             sbuf.get_bounds (out start, out end);
             sbuf.remove_source_marks (start, end, null); // remove all marks..
             
-            buf.
             
+            while(Gtk.events_pending()) {
+                Gtk.main_iteration();
+            }
+            
+            Gtk.TextIter cpos_iter;
+            buf.get_iter_at_offset(out cpos_iter, cpos);
+            buf.place_cursor(cpos_iter); 
             
+            this.el.set_vadjustment(vadj);
+            this.onCursorChanged();
             
             
             this.loading = false;