src/Builder4/WindowRooView.bjs
[app.Builder.js] / src / Builder4 / WindowRooView.vala
index 81744a6..2818e6e 100644 (file)
@@ -1053,6 +1053,10 @@ public class Xcls_WindowRooView : Object
                 print("prop : %s", prop == null ? "???" : prop);
                 
                 
+                
+                
+                
+                
                 var ltree = _this.main_window.windowstate.left_tree;
                 var tp = ltree.model.treePathFromNode(node);
                 print("got tree path %s\n", tp);
@@ -1081,9 +1085,9 @@ public class Xcls_WindowRooView : Object
                                        
                                }
                     }
-                    
-                   ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); 
-                   
+                    ltree.view.setCursor(tp, "editor");
+                   // ltree.view.el.set_cursor(new Gtk.TreePath.from_string(tp), null, false); 
+                   this.nodeSelected(node);
                     
                     // scrolling is disabled... as node selection calls scroll 10ms after it changes.
                     GLib.Timeout.add_full(GLib.Priority.DEFAULT,100 , () => {
@@ -1160,6 +1164,18 @@ public class Xcls_WindowRooView : Object
                        
             }
             
+            // check selection - if it's out of 'bounds'
+            if (this.el.editable && sbuf.get_has_selection()) {
+                       Gtk.TextIter sel_start_iter, sel_end_iter;
+                       sbuf.get_selection_bounds(out sel_start_iter, out sel_end_iter);
+                       if (sel_start_iter.get_line() < start_line || sel_start_iter.get_line() > end_line) {
+                               // save?
+                               this.el.editable = false;
+                       }
+            
+            }
+            
+            
             
             
             for (var i = 0; i < buf.get_line_count();i++) {