src/Builder4/WindowRooView.bjs
[app.Builder.js] / src / Builder4 / WindowRooView.vala
index 47068b3..30e0656 100644 (file)
@@ -1139,6 +1139,9 @@ public class Xcls_WindowRooView : Object
             
             Gtk.TextIter cur_iter;
             sbuf.get_iter_at_offset(out cur_iter, sbuf.cursor_position);
+           
+            var cursor_at_line = cur_iter.get_line();
+            
             
             //var cur_line = cur_iter.get_line();
             //if (cur_line > sel.line_start && cur_line < sel.line_end) {
@@ -1161,6 +1164,12 @@ public class Xcls_WindowRooView : Object
                        if (sel.getPropertyRange(this.propSelected, out nstart, out nend) && nend > nstart) {
                                start_line = nstart;
                                end_line = nend;
+                               
+                               if (start_line == cursor_at_line) {
+                                       // see if we are 'right of ':'
+                                       
+                               }
+                               
                                this.el.editable = true;
                        }
                        print("propSelected = %s range  %d -> %d\n", this.propSelected, start_line, end_line);          
@@ -1168,6 +1177,9 @@ 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;
@@ -1310,10 +1322,15 @@ public class Xcls_WindowRooView : Object
                
                 print("- PREVIEW EDITOR CHANGED--");
                 
+                this.dirty = true;    
+                if (!this.checkSyntax()) {
+                       return;
+               }               
                 
-                 this.checkSyntax();
+               // what are we editing??
                
-                this.dirty = true;
+               
+            
             
             
                 return ;
@@ -1370,29 +1387,29 @@ public class Xcls_WindowRooView : Object
             
             if (str.length < 1) {
                 print("checkSyntax - empty string?\n");
-                return true;
+                return false;
             }
             
            if (_this.file == null) {
-               return true;
+               return false;
            }
             var p = Palete.factory(_this.file.xtype);  // returns Roo | Gtk  | PlainFile 
             
          
             if (_this.file.language != "js") {
-                       return;
+                       return false; // fake syntax error.
                }
                
                 
         
-               var res =  this.highlightErrors(p.validateJavascript(
+               return this.highlightErrors(p.validateJavascript(
                 str, 
                  "", // _this.key, 
                 "file", //_this.ptype,
                 _this.file,
                 null
             ));    
-            return res;
+             
         }
     }