src/Builder4/WindowRooView.bjs
[app.Builder.js] / src / Builder4 / WindowRooView.vala
index 68a4679..4582600 100644 (file)
@@ -1031,9 +1031,9 @@ public class Xcls_WindowRooView : Object
             
                return false;
             });
-            this.el.key_press_event.connect( () {
-               
-            
+            this.el.key_press_event.connect( () => {
+               this.onCursorChanged();
+               return false; 
             });
         }
 
@@ -1135,6 +1135,9 @@ public class Xcls_WindowRooView : Object
             this.node_selected = sel;
             
             this.updateGreySelection(scroll);
+            
+            
+            
         }
         public string toString () {
            Gtk.TextIter s;
@@ -1190,14 +1193,18 @@ public class Xcls_WindowRooView : Object
             sbuf.remove_source_marks (start, end, null); // remove all marks..
             
              GLib.Timeout.add(500, () => {
-               
-               print("RESORTING cursor to = %d\n", cpos);
+        
+                print("RESORTING cursor to = %d\n", cpos);
                        Gtk.TextIter cpos_iter;
                        buf.get_iter_at_offset(out cpos_iter, cpos);
                        buf.place_cursor(cpos_iter); 
                        
                        this.el.get_vadjustment().set_value(vadj_pos);;
+                       
+        
                        this.onCursorChanged();
+                       
+                       
                        _this.buffer.checkSyntax();
                        return false;
                });
@@ -1273,7 +1280,7 @@ public class Xcls_WindowRooView : Object
                                        var first_line  = this.el.buffer.get_text(start_line_iter, end_line_iter, false);
                                        print("first line = %s\n", first_line);
                                        if (first_line.contains(":")) {
-                                               colon_pos = start_line_iter.get_offset() + first_line.index_of(":");
+                                               colon_pos = start_line_iter.get_offset() + first_line.index_of(":") + 1;
                                        }
                                        print("colon_pos  = %d\n", colon_pos);
                                }
@@ -1331,7 +1338,12 @@ public class Xcls_WindowRooView : Object
                 }
             
             }
-            
+            if (scroll) {
+                   Gtk.TextIter cpos_iter;
+                       buf.get_iter_at_line(out cpos_iter, start_line);
+                       buf.place_cursor(cpos_iter); 
+               }
+        
         
         }
         public void highlightErrorsJson (string type, Json.Object obj) {
@@ -1457,15 +1469,16 @@ public class Xcls_WindowRooView : Object
                        return false; // fake syntax error.
                }
                
-                
+            //Gee.HashMap<int,string> ret_x;
         
-               return this.highlightErrors(p.validateJavascript(
+               return p.javascriptHasErrors(
+                       _this.main_window.windowstate,
                 str, 
                  "", // _this.key, 
                 "file", //_this.ptype,
-                _this.file,
+                _this.file, 
                 null
-            ));    
+            );    
              
         }
     }