fix #7968 - language server support for syntax check and completion
[roobuilder] / src / Builder4 / Editor.vala
index 0bcbaaa..c1cca4b 100644 (file)
@@ -19,23 +19,25 @@ public class Editor : Object
     public Xcls_buffer buffer;
     public Xcls_search_entry search_entry;
     public Xcls_search_results search_results;
+    public Xcls_nextBtn nextBtn;
+    public Xcls_backBtn backBtn;
     public Xcls_search_settings search_settings;
     public Xcls_case_sensitive case_sensitive;
     public Xcls_regex regex;
     public Xcls_multiline multiline;
 
         // my vars (def)
-    public Xcls_MainWindow window;
     public int pos_root_x;
+    public Xcls_MainWindow window;
     public bool dirty;
     public int pos_root_y;
     public bool pos;
-    public Gtk.SourceSearchContext searchcontext;
+    public GtkSource.SearchContext searchcontext;
     public int last_search_end;
-    public JsRender.NodeProp? prop;
+    public signal void save ();
     public JsRender.JsRender? file;
     public JsRender.Node node;
-    public signal void save ();
+    public JsRender.NodeProp? prop;
     public string activeEditor;
 
     // ctor
@@ -50,24 +52,24 @@ public class Editor : Object
         this.pos = false;
         this.searchcontext = null;
         this.last_search_end = 0;
-        this.prop = null;
         this.file = null;
         this.node = null;
+        this.prop = null;
         this.activeEditor = "";
 
         // set gobject values
         this.el.homogeneous = false;
         this.el.hexpand = true;
         this.el.vexpand = true;
-        var child_0 = new Xcls_Box2( _this );
-        child_0.ref();
-        this.el.pack_start (  child_0.el , false,true );
-        var child_1 = new Xcls_RightEditor( _this );
+        var child_1 = new Xcls_Box2( _this );
         child_1.ref();
-        this.el.add(  child_1.el );
-        var child_2 = new Xcls_Box12( _this );
+        this.el.append( child_1.el );
+        var child_2 = new Xcls_RightEditor( _this );
         child_2.ref();
-        this.el.add(  child_2.el );
+        this.el.append( child_2.el );
+        var child_3 = new Xcls_Box12( _this );
+        child_3.ref();
+        this.el.append ( child_3.el  );
     }
 
     // user defined functions
@@ -94,7 +96,7 @@ public class Editor : Object
         if (_this.file.xtype != "PlainFile") {
            // in theory these properties have to exist!?!
                this.prop.val = str;
-            this.window.windowstate.left_props.reload();
+            //this.window.windowstate.left_props.reload();
         } else {
             _this.file.setSource(  str );
          }
@@ -114,7 +116,7 @@ public class Editor : Object
        Gtk.TextIter beg, st,en;
         bool has_wrapped_around;
        this.buffer.el.get_iter_at_offset(out beg, this.last_search_end);
-       if (!this.searchcontext.forward2(beg, out st, out en, out has_wrapped_around)) {
+       if (!this.searchcontext.forward(beg, out st, out en, out has_wrapped_around)) {
        
                this.last_search_end = 0; // not sure if this should happen
        } else {
@@ -142,6 +144,8 @@ public class Editor : Object
     
             // find the text for the node..
             this.view.load( prop.val );
+            
+            
             this.close_btn.el.show();       
         
         } else {
@@ -160,8 +164,7 @@ public class Editor : Object
        bool has_wrapped_around;
        this.buffer.el.get_iter_at_offset(out beg, this.last_search_end -1 );
        
-       if (!this.searchcontext.backward2(beg, out st, out en, out has_wrapped_around)) {
-       
+       if (!this.searchcontext.backward(beg, out st, out en, out has_wrapped_around)) {
                this.last_search_end = 0;
        } else {
                this.last_search_end = en.get_offset();
@@ -171,16 +174,24 @@ public class Editor : Object
                this.buffer.el.place_cursor(st);
                this.view.el.scroll_to_iter(st,  0.1f, true, 0.0f, 0.5f);
        }
-     
+    
+    }
+    public void reset () {
+        this.file = null;    
+         
+        this.node = null;
+        this.prop = null;
+       this.searchcontext = null;
+      
     }
     public int search (string in_txt) {
     
-       var s = new Gtk.SourceSearchSettings();
+       var s = new GtkSource.SearchSettings();
        s.case_sensitive = _this.case_sensitive.el.active;
        s.regex_enabled = _this.regex.el.active;        
        s.wrap_around = false;
        
-       this.searchcontext = new Gtk.SourceSearchContext(this.buffer.el,s);
+       this.searchcontext = new GtkSource.SearchContext(this.buffer.el,s);
        this.searchcontext.set_highlight(true);
        var txt = in_txt;
        
@@ -192,7 +203,8 @@ public class Editor : Object
        Gtk.TextIter beg, st,en;
         
        this.buffer.el.get_start_iter(out beg);
-       this.searchcontext.forward(beg, out st, out en);
+       bool has_wrapped_around;
+       this.searchcontext.forward(beg, out st, out en, out has_wrapped_around);
        this.last_search_end = 0;
        
        return this.searchcontext.get_occurrences_count();
@@ -201,13 +213,86 @@ public class Editor : Object
        
     
     }
-    public void reset () {
-        this.file = null;    
-         
-        this.node = null;
-        this.prop = null;
-       this.searchcontext = null;
-      
+    public void updateErrorMarks (string category) {
+       
+     
+    
+       var buf = _this.buffer.el;
+       Gtk.TextIter start;
+       Gtk.TextIter end;     
+       buf.get_bounds (out start, out end);
+    
+       buf.remove_source_marks (start, end, category);
+     
+       GLib.debug("highlight errors");          
+    
+        // we should highlight other types of errors..
+    
+       if (_this.window.windowstate.state != WindowState.State.CODEONLY 
+               &&
+               _this.window.windowstate.state != WindowState.State.CODE
+               ) {
+               GLib.debug("windowstate != CODEONLY?");
+               
+               return;
+       } 
+    
+        
+       if (_this.file == null) {
+               GLib.debug("file is null?");
+               return;
+    
+       }
+       var ar = this.file.getErrors(category);
+       if (ar == null || ar.get_n_items() < 1) {
+               GLib.debug("highlight %s :  %s has no errors", this.file.relpath, category);
+               return;
+       }
+     
+    
+     
+       
+       var offset = 0;
+        
+    
+       var tlines = buf.get_line_count () +1;
+       
+       if (_this.prop != null) {
+       
+               tlines = _this.prop.end_line + 1;
+               offset = _this.prop.start_line + 1;
+       
+       }
+        
+       for (var i = 0; i < ar.get_n_items();i++) {
+               var err = (Palete.CompileError) ar.get_item(i);
+               
+            Gtk.TextIter iter;
+    //        print("get inter\n");
+           var eline = err.line - offset;
+           GLib.debug("GOT ERROR on line %d -- converted to %d  (offset = %d)",
+               err.line ,eline, offset);
+           
+           
+           if (eline > tlines || eline < 0) {
+               return;
+           }
+          
+           
+           buf.get_iter_at_line( out iter, eline);
+          
+          
+               var msg = "Line: %d %s : %s".printf(eline+1, err.category, err.msg);
+           buf.create_source_mark( msg, err.category, iter);
+           GLib.debug("set line %d to %s", eline, msg);
+           //this.marks.set(eline, msg);
+       }
+       return ;
+    
+    
+    
+     
+    
     }
     public void scroll_to_line (int line) {
     
@@ -215,7 +300,7 @@ public class Editor : Object
        
                var buf = this.view.el.get_buffer();
     
-               var sbuf = (Gtk.SourceBuffer) buf;
+               var sbuf = (GtkSource.Buffer) buf;
     
     
                Gtk.TextIter iter;   
@@ -242,18 +327,19 @@ public class Editor : Object
 
             // set gobject values
             this.el.homogeneous = false;
-            var child_0 = new Xcls_save_button( _this );
-            child_0.ref();
-            this.el.add (  child_0.el  );
-            var child_1 = new Xcls_Label5( _this );
+            this.el.hexpand = true;
+            var child_1 = new Xcls_save_button( _this );
             child_1.ref();
-            this.el.add (  child_1.el  );
-            var child_2 = new Xcls_HScale6( _this );
+            this.el.append( child_1.el );
+            var child_2 = new Xcls_Label4( _this );
             child_2.ref();
-            this.el.add (  child_2.el  );
-            var child_3 = new Xcls_close_btn( _this );
+            this.el.append( child_2.el );
+            var child_3 = new Xcls_Scale5( _this );
             child_3.ref();
-            this.el.add (  child_3.el  );
+            this.el.append( child_3.el );
+            var child_4 = new Xcls_close_btn( _this );
+            child_4.ref();
+            this.el.append( child_4.el );
         }
 
         // user defined functions
@@ -276,11 +362,7 @@ public class Editor : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.always_show_image = true;
             this.el.label = "Save";
-            var child_0 = new Xcls_Image4( _this );
-            child_0.ref();
-            this.el.image = child_0.el;
 
             //listeners
             this.el.clicked.connect( () => { 
@@ -290,31 +372,8 @@ public class Editor : Object
 
         // user defined functions
     }
-    public class Xcls_Image4 : Object
-    {
-        public Gtk.Image el;
-        private Editor  _this;
-
-
-            // my vars (def)
-
-        // ctor
-        public Xcls_Image4(Editor _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Image();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.icon_name = "document-save";
-        }
-
-        // user defined functions
-    }
-
 
-    public class Xcls_Label5 : Object
+    public class Xcls_Label4 : Object
     {
         public Gtk.Label el;
         private Editor  _this;
@@ -323,7 +382,7 @@ public class Editor : Object
             // my vars (def)
 
         // ctor
-        public Xcls_Label5(Editor _owner )
+        public Xcls_Label4(Editor _owner )
         {
             _this = _owner;
             this.el = new Gtk.Label( null );
@@ -337,26 +396,26 @@ public class Editor : Object
         // user defined functions
     }
 
-    public class Xcls_HScale6 : Object
+    public class Xcls_Scale5 : Object
     {
-        public Gtk.HScale el;
+        public Gtk.Scale el;
         private Editor  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_HScale6(Editor _owner )
+        public Xcls_Scale5(Editor _owner )
         {
             _this = _owner;
-            this.el = new Gtk.HScale.with_range (6, 30, 1);
+            this.el = new Gtk.Scale.with_range (Gtk.Orientation.HORIZONTAL,6, 30, 1);
 
             // my vars (dec)
 
             // set gobject values
             this.el.width_request = 200;
             this.el.has_origin = true;
-            this.el.draw_value = true;
+            this.el.draw_value = false;
             this.el.digits = 0;
             this.el.sensitive = true;
 
@@ -370,11 +429,12 @@ public class Editor : Object
             //listeners
             this.el.change_value.connect( (st, val ) => {
                 
-                 var description =   Pango.FontDescription.from_string("monospace");
-                 print("resize to %d", (int)val*1000);
-                  description.set_size((int)val*1000);
-                  _this.view.el.override_font(description);
-                  return false;
+                  
+                 _this.view.css.load_from_string(
+                               "#editor-view { font: %dpx monospace; }".printf((int)val)
+                  );
+                 
+               return false;
             });
         }
 
@@ -399,10 +459,10 @@ public class Editor : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.always_show_image = true;
-            var child_0 = new Xcls_Image8( _this );
-            child_0.ref();
-            this.el.image = child_0.el;
+            this.el.icon_name = "window-close";
+            var child_1 = new Xcls_Image7( _this );
+            child_1.ref();
+            this.el.child = child_1.el;
 
             //listeners
             this.el.clicked.connect( () => { 
@@ -413,7 +473,7 @@ public class Editor : Object
 
         // user defined functions
     }
-    public class Xcls_Image8 : Object
+    public class Xcls_Image7 : Object
     {
         public Gtk.Image el;
         private Editor  _this;
@@ -422,7 +482,7 @@ public class Editor : Object
             // my vars (def)
 
         // ctor
-        public Xcls_Image8(Editor _owner )
+        public Xcls_Image7(Editor _owner )
         {
             _this = _owner;
             this.el = new Gtk.Image();
@@ -431,6 +491,7 @@ public class Editor : Object
 
             // set gobject values
             this.el.icon_name = "window-close";
+            this.el.icon_size = Gtk.IconSize.NORMAL;
         }
 
         // user defined functions
@@ -451,127 +512,213 @@ public class Editor : Object
         {
             _this = _owner;
             _this.RightEditor = this;
-            this.el = new Gtk.ScrolledWindow( null, null );
+            this.el = new Gtk.ScrolledWindow();
 
             // my vars (dec)
 
             // set gobject values
+            this.el.vscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
             this.el.vexpand = true;
-            var child_0 = new Xcls_view( _this );
-            child_0.ref();
-            this.el.add (  child_0.el  );
-
-            // init method
-
-            this.el.set_policy(Gtk.PolicyType.AUTOMATIC, Gtk.PolicyType.AUTOMATIC);
+            this.el.overlay_scrolling = false;
+            this.el.hscrollbar_policy = Gtk.PolicyType.AUTOMATIC;
+            var child_1 = new Xcls_view( _this );
+            child_1.ref();
+            this.el.child = child_1.el;
         }
 
         // user defined functions
     }
     public class Xcls_view : Object
     {
-        public Gtk.SourceView el;
+        public GtkSource.View el;
         private Editor  _this;
 
 
             // my vars (def)
+        public Gtk.CssProvider css;
 
         // ctor
         public Xcls_view(Editor _owner )
         {
             _this = _owner;
             _this.view = this;
-            this.el = new Gtk.SourceView();
+            this.el = new GtkSource.View();
 
             // my vars (dec)
+            this.css = null;
 
             // set gobject values
             this.el.auto_indent = true;
             this.el.indent_width = 4;
+            this.el.name = "editor-view";
             this.el.show_line_marks = true;
             this.el.insert_spaces_instead_of_tabs = true;
             this.el.show_line_numbers = true;
-            this.el.draw_spaces = Gtk.SourceDrawSpacesFlags.LEADING + Gtk.SourceDrawSpacesFlags.TRAILING + Gtk.SourceDrawSpacesFlags.TAB + Gtk.SourceDrawSpacesFlags.SPACE;
+            this.el.hexpand = true;
+            this.el.vexpand = true;
+            this.el.has_tooltip = true;
             this.el.tab_width = 4;
             this.el.highlight_current_line = true;
-            var child_0 = new Xcls_buffer( _this );
-            child_0.ref();
-            this.el.set_buffer (  child_0.el  );
+            var child_1 = new Xcls_buffer( _this );
+            child_1.ref();
+            this.el.buffer = child_1.el;
+            var child_2 = new Xcls_EventControllerKey11( _this );
+            child_2.ref();
+            this.el.add_controller(  child_2.el );
 
             // init method
 
-            var description =   Pango.FontDescription.from_string("monospace");
-                       description.set_size(8000);
-            
-                        this.el.override_font(description);
+            this.css = new Gtk.CssProvider();
             
-               try {        
-                       this.el.completion.add_provider(new Palete.CompletionProvider(_this));
-                } catch (GLib.Error  e) {}
-                
-               this.el.completion.unblock_interactive();
-               this.el.completion.select_on_show                       = true; // select
-               this.el.completion.show_headers                 = false;
-               this.el.completion.remember_info_visibility             = true;
-                
-              
-                var attrs = new Gtk.SourceMarkAttributes();
-                var  pink =   Gdk.RGBA();
-                pink.parse ( "pink");
-                attrs.set_background ( pink);
-                attrs.set_icon_name ( "process-stop");    
-                attrs.query_tooltip_text.connect(( mark) => {
-                    //print("tooltip query? %s\n", mark.name);
-                    return mark.name;
-                });
-                
-                this.el.set_mark_attributes ("ERR", attrs, 1);
-                
-                 var wattrs = new Gtk.SourceMarkAttributes();
-                var  blue =   Gdk.RGBA();
-                blue.parse ( "#ABF4EB");
-                wattrs.set_background ( blue);
-                wattrs.set_icon_name ( "process-stop");    
-                wattrs.query_tooltip_text.connect(( mark) => {
-                    //print("tooltip query? %s\n", mark.name);
-                    return mark.name;
-                });
-                
-                this.el.set_mark_attributes ("WARN", wattrs, 1);
-                
+            this.css.load_from_string(
+               "#editor-view { font:  12px monospace;}"
+            );
              
-                
-                 var dattrs = new Gtk.SourceMarkAttributes();
-                var  purple =   Gdk.RGBA();
-                purple.parse ( "#EEA9FF");
-                dattrs.set_background ( purple);
-                dattrs.set_icon_name ( "process-stop");    
-                dattrs.query_tooltip_text.connect(( mark) => {
-                    //print("tooltip query? %s\n", mark.name);
-                    return mark.name;
-                });
-                
-                this.el.set_mark_attributes ("DEPR", dattrs, 1);
+            Gtk.StyleContext.add_provider_for_display(
+               this.el.get_display(),
+               this.css,
+               Gtk.STYLE_PROVIDER_PRIORITY_APPLICATION
+            );
+               
+             
+                
+            /*
+            this is pretty flakey - triggers Gtk with  < 0 d
+             var cp = new GtkSource.CompletionWords("test"); 
+             cp.minimum_word_size  = 3;
+             //cp.priority = 100; //?? does this do anything
+             cp.proposals_batch_size  = 10;
+             cp.scan_batch_size = 1000;
+             
+            cp.register(_this.buffer.el);
+            this.el.completion.add_provider(cp);
+            */
+            this.el.completion.add_provider(new Palete.CompletionProvider(_this));
+              
+            //this.el.completion.unblock_interactive();
+            this.el.completion.select_on_show = true; // select
+            //this.el.completion.remember_info_visibility       = true;
+            
+            
+            var attrs = new GtkSource.MarkAttributes();
+            var  pink =   Gdk.RGBA();
+            pink.parse ( "pink");
+            attrs.set_background ( pink);
+            attrs.set_icon_name ( "process-stop");    
+            attrs.query_tooltip_text.connect(( mark) => {
+                 GLib.debug("tooltip query? %s", mark.name);
+                return strdup( mark.name);
+            });
+             attrs.query_tooltip_markup.connect(( mark) => {
+                 GLib.debug("tooltip query? %s", mark.name);
+                return strdup( mark.name);
+            });
+            this.el.set_mark_attributes ("ERR", attrs, 1);
+            attrs.ref();
+             var wattrs = new GtkSource.MarkAttributes();
+            var  blue =   Gdk.RGBA();
+            blue.parse ( "#ABF4EB");
+            wattrs.set_background ( blue);
+            wattrs.set_icon_name ( "process-stop");    
+            wattrs.query_tooltip_text.connect(( mark) => {
+                 GLib.debug("tooltip query? %s", mark.name);
+                return strdup(mark.name);
+            });
+            wattrs.query_tooltip_markup.connect(( mark) => {
+                 GLib.debug("tooltip query? %s", mark.name);
+                return strdup(mark.name);
+            });
+            this.el.set_mark_attributes ("WARN", wattrs, 1);
+            wattrs.ref();
+            
+            
+             var dattrs = new GtkSource.MarkAttributes();
+            var  purple =   Gdk.RGBA();
+            purple.parse ( "#EEA9FF");
+            dattrs.set_background ( purple);
+            dattrs.set_icon_name ( "process-stop");    
+            dattrs.query_tooltip_text.connect(( mark) => {
+               GLib.debug("tooltip query? %s", mark.name);
+                return strdup(mark.name);
+            });
+            dattrs.query_tooltip_markup.connect(( mark) => {
+               GLib.debug("tooltip query? %s", mark.name);
+                return strdup(mark.name);
+            });
+            this.el.set_mark_attributes ("DEPR", dattrs, 1);
+            dattrs.ref();    
+            
+             this.el.get_space_drawer().set_matrix(null);
+             this.el.get_space_drawer().set_types_for_locations( 
+               GtkSource.SpaceLocationFlags.ALL,
+               GtkSource.SpaceTypeFlags.ALL
+            );
+            this.el.get_space_drawer().set_enable_matrix(true);
+            /*
+            Gtk.SourceDrawSpacesFlags.LEADING + 
+            Gtk.SourceDrawSpacesFlags.TRAILING + 
+            Gtk.SourceDrawSpacesFlags.TAB + 
+            Gtk.SourceDrawSpacesFlags.SPACE
+            */
 
             //listeners
-            this.el.key_release_event.connect( (event) => {
-                
-                if (event.keyval == Gdk.Key.s && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
-                    GLib.debug("SAVE: ctrl-S  pressed");
-                    _this.saveContents();
-                    return false;
-                }
-                
-                if (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
-                   GLib.debug("SAVE: ctrl-g  pressed");
-                       _this.forwardSearch(true);
-                   return true;
-               }
-                
-               // print(event.key.keyval)
-                
-                return false;
+            this.el.query_tooltip.connect( (x, y, keyboard_tooltip, tooltip) => {
+               
+               //GLib.debug("query tooltip");
+               Gtk.TextIter iter;
+               int trailing;
+               
+               var yoff = (int) _this.RightEditor.el.vadjustment.value;
+               
+               // I think this is problematic - if it's compliing  / updating at same time as query.
+               
+               //if (_this.window.statusbar_compile_spinner.el.spinning) {
+               //      return false;
+               //}
+               
+               this.el.get_iter_at_position (out iter, out trailing,  x,  y + yoff);
+                
+               var l = iter.get_line();
+            
+               
+                
+               // GLib.debug("query tooltip line %d", (int) l);
+               if (l < 0) {
             
+                       return false;
+               }
+               /*
+               if (_this.buffer.marks != null && _this.buffer.marks.has_key(l)) {
+                       GLib.debug("line %d setting tip to %s", l,  _this.buffer.marks.get(l));
+                       tooltip.set_text(_this.buffer.marks.get(l).dup());
+                       return true;
+               }
+             
+               return false;
+               */
+               
+                 
+               // this crashes?? - not sure why.
+               var marks = _this.buffer.el.get_source_marks_at_line(l, "ERR");
+               if (marks.is_empty()) {
+                       marks = _this.buffer.el.get_source_marks_at_line(l, "WARN");
+               }
+               if (marks.is_empty()) {
+                       marks = _this.buffer.el.get_source_marks_at_line(l, "DEPR");
+               }
+               
+               // GLib.debug("query tooltip line %d marks %d", (int)l, (int) marks.length());
+               var str = "";
+               marks.@foreach((m) => { 
+                       //GLib.debug("got mark %s", m.name);
+                       str += (str.length > 0 ? "\n" : "") + m.category + ": " + m.name;
+               });
+               // true if there is a mark..
+               if (str.length > 0 ) {
+                       tooltip.set_text( str );
+               }
+               return str.length > 0 ? true : false;
+                
             });
         }
 
@@ -580,14 +727,16 @@ public class Editor : Object
         
         // show the help page for the active node..
            //this.get('/Help').show();
-        
-        
+         
           // this.get('/BottomPane').el.set_current_page(0);
-            var buf = (Gtk.SourceBuffer)this.el.get_buffer();
+               GLib.debug("load called - Reset undo buffer");
+               
+            var buf = (GtkSource.Buffer)this.el.get_buffer();
+            buf.begin_irreversible_action();
             buf.set_text(str, str.length);
-            buf.set_undo_manager(null);
+            buf.end_irreversible_action();
             
-            var lm = Gtk.SourceLanguageManager.get_default();
+            var lm = GtkSource.LanguageManager.get_default();
             var lang = "vala";
             if (_this.file != null) {
                  lang = _this.file.language;
@@ -598,7 +747,7 @@ public class Editor : Object
                     lm.get_language(lang);
              
            
-            ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lg); 
+            ((GtkSource.Buffer)(this.el.get_buffer())) .set_language(lg); 
         
             this.el.insert_spaces_instead_of_tabs = true;
             if (lg != null) {
@@ -614,28 +763,29 @@ public class Editor : Object
     }
     public class Xcls_buffer : Object
     {
-        public Gtk.SourceBuffer el;
+        public GtkSource.Buffer el;
         private Editor  _this;
 
 
             // my vars (def)
         public int error_line;
+        public Gee.HashMap<int,string>? xmarks;
         public bool check_queued;
-        public bool check_running;
 
         // ctor
         public Xcls_buffer(Editor _owner )
         {
             _this = _owner;
             _this.buffer = this;
-            this.el = new Gtk.SourceBuffer( null );
+            this.el = new GtkSource.Buffer( null );
 
             // my vars (dec)
             this.error_line = -1;
+            this.xmarks = null;
             this.check_queued = false;
-            this.check_running = false;
 
             // set gobject values
+            this.el.enable_undo = true;
 
             //listeners
             this.el.changed.connect( () => {
@@ -655,24 +805,7 @@ public class Editor : Object
         // user defined functions
         public bool checkSyntax () {
          
-            if (this.check_running) {
-                print("Check is running\n");
-                if (this.check_queued) { 
-                    print("Check is already queued");
-                    return true;
-                }
-                this.check_queued = true;
-                print("Adding queued Check ");
-                GLib.Timeout.add_seconds(1, () => {
-                    this.check_queued = false;
-                    
-                    this.checkSyntax();
-                    return false;
-                });
             
-        
-                return true;
-            }
             var str = this.toString();
             
             // needed???
@@ -688,60 +821,37 @@ public class Editor : Object
                 return true;
             }
             
+            // bit presumptiona
             if (_this.file.xtype == "PlainFile") {
             
                 // assume it's gtk...
-                   this.check_running = true;
-         
-                 if (!BuilderApplication.valasource.checkPlainFileSpawn(
-                  _this.file,
-                   str
-                )) {
-                    this.check_running = false;
-                }
-               
+                 var  oldcode =_this.file.toSource();
+                _this.file.setSource(str);
+                _this.file.getLanguageServer().document_change(_this.file);
+                _this.file.setSource(oldcode);
+                
+                        
                 return true;
             
             }
            if (_this.file == null) {
                return true;
            }
-            var p = _this.file.project.palete;
+         
             
         
+              
              
-            this.check_running = true;
-            
-            
-            if (_this.file.language == "js") {
-                this.check_running = false;
-                print("calling validate javascript\n"); 
-                Gee.HashMap<int,string> errors;
-                p.javascriptHasErrors(
-                       _this.window.windowstate,
-                    str, 
-                     _this.prop,
-                    _this.file,   // no reference not node?
-                    out errors
-                );
-                return this.highlightErrors(errors);    
-                
-            }
-                
-                
-            print("calling validate vala\n");    
+            GLib.debug("calling validate");    
             // clear the buttons.
-         
-            
-           if (! BuilderApplication.valasource.checkFileWithNodePropChange(
-                _this.file,
-                _this.node,
-                 _this.prop,        
-                    str
-                )) {
-                this.check_running = false;
-            } 
-             
+               if (_this.prop.name == "xns" || _this.prop.name == "xtype") {
+                       return true ;
+               }
+               var oldcode  = _this.prop.val;
+               
+               _this.prop.val = str;
+            _this.file.getLanguageServer().document_change(_this.file);
+            _this.prop.val = oldcode;
             
             
             //print("done mark line\n");
@@ -749,125 +859,139 @@ public class Editor : Object
             return true; // at present allow saving - even if it's invalid..
         }
         public bool highlightErrorsJson (string type, Json.Object obj) {
-              Gtk.TextIter start;
-             Gtk.TextIter end;     
-                this.el.get_bounds (out start, out end);
-                
-                this.el.remove_source_marks (start, end, type);
-                         
-             
-             // we should highlight other types of errors..
-            
-            if (!obj.has_member(type)) {
-                print("Return has no errors\n");
-                return true;
-            }
-            
-            if (_this.window.windowstate.state != WindowState.State.CODEONLY 
-              
-                ) {
-                return true;
-            } 
-            
-            
-            var err = obj.get_object_member(type);
-            
-            
-            if (_this.file == null) {
-                return true;
-            
-            }
-            var valafn = _this.file.path;
+               Gtk.TextIter start;
+               Gtk.TextIter end;     
+               this.el.get_bounds (out start, out end);
+        
+               this.el.remove_source_marks (start, end, type);
+               GLib.debug("highlight errors");          
+        
+                // we should highlight other types of errors..
+        
+               if (!obj.has_member(type)) {
+                       GLib.debug("Return has no errors\n");
+                       return true;
+               }
+        
+               if (_this.window.windowstate.state != WindowState.State.CODEONLY 
+                       &&
+                       _this.window.windowstate.state != WindowState.State.CODE
+                       ) {
+                       GLib.debug("windowstate != CODEONLY?");
+                       
+                       return true;
+               } 
+        
+               //this.marks = new Gee.HashMap<int,string>();
+               var err = obj.get_object_member(type);
          
-            if (_this.file.xtype != "PlainFile") {
+               if (_this.file == null) {
+                       GLib.debug("file is null?");
+                       return true;
         
+               }
+               var valafn = _this.file.path;
         
-                
-                
-                 valafn = "";
-                  try {             
-                       var  regex = new Regex("\\.bjs$");
-                       // should not happen
-                      
-                     
-                        valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
-                     } catch (GLib.RegexError e) {
-                        return true;
-                    }   
+               if (_this.file.xtype != "PlainFile") {
         
+                       valafn = "";
+                       try {             
+                               var  regex = new Regex("\\.bjs$");
+                               // should not happen
+                               valafn = regex.replace(_this.file.path,_this.file.path.length , 0 , ".vala");
+                       } catch (GLib.RegexError e) {
+                               return true;
+                       }   
         
         
-              }
-               if (!err.has_member(valafn)) {
-                    print("File path has no errors\n");
-                    return  true;
-                }
         
-                var lines = err.get_object_member(valafn);
-                
-                var offset = 1;
-                if (obj.has_member("line_offset")) {
-                    offset = (int)obj.get_int_member("line_offset") + 1;
-                }
-            
+               }
+               if (!err.has_member(valafn)) {
+                       GLib.debug("File path has no errors");
+                       return  true;
+               }
         
-             
-            
-            var tlines = this.el.get_line_count () +1;
-            
-            lines.foreach_member((obj, line, node) => {
-                
-                     Gtk.TextIter iter;
-            //        print("get inter\n");
-                    var eline = int.parse(line) - offset;
-                    print("GOT ERROR on line %s -- converted to %d\n", line,eline);
-                    
-                    
-                    if (eline > tlines || eline < 0) {
-                        return;
-                    }
-                    this.el.get_iter_at_line( out iter, eline);
-                    //print("mark line\n");
-                    var msg  = "Line: %d".printf(eline+1);
-                    var ar = lines.get_array_member(line);
-                    for (var i = 0 ; i < ar.get_length(); i++) {
-                           msg += (msg.length > 0) ? "\n" : "";
-                           msg += ar.get_string_element(i);
+               var lines = err.get_object_member(valafn);
+               
+               var offset = 1;
+               if (obj.has_member("line_offset")) { // ?? why??
+                       offset = (int)obj.get_int_member("line_offset") + 1;
+               }
+        
+        
+               var tlines = this.el.get_line_count () +1;
+               
+               if (_this.prop != null) {
+               
+                       tlines = _this.prop.end_line + 1;
+                       offset = _this.prop.start_line + 1;
+               
+               }
+               
+        
+        
+               lines.foreach_member((obj, line, node) => {
+                       
+                    Gtk.TextIter iter;
+        //        print("get inter\n");
+                   var eline = int.parse(line) - offset;
+                   GLib.debug("GOT ERROR on line %s -- converted to %d  (offset = %d)\n", line,eline, offset);
+                   
+                   
+                   if (eline > tlines || eline < 0) {
+                       return;
                    }
-                    
-                    
-                    this.el.create_source_mark(msg, type, iter);
-                } );
-                return false;
-            
+                  
+                   
+                   this.el.get_iter_at_line( out iter, eline);
+                   //print("mark line\n");
+                   var msg  = "";
+                   var ar = lines.get_array_member(line);
+                   for (var i = 0 ; i < ar.get_length(); i++) {
+                       if (ar.get_string_element(i) == "Success") {
+                               continue;
+                       }
+                               msg += (msg.length > 0) ? "\n" : "";
+                               msg += ar.get_string_element(i);
+                       }
+                       if (msg == "") {
+                               return;
+                       }
+                       msg = "Line: %d".printf(eline+1) +  " " + msg;
+                   this.el.create_source_mark(msg, type, iter);
+                   GLib.debug("set line %d to %m", eline, msg);
+                  // this.marks.set(eline, msg);
+               } );
+               return false;
         
         
         
         
-        }
+        
+               }
         public bool highlightErrors ( Gee.HashMap<int,string> validate_res) {
                  
-                this.error_line = validate_res.size;
+               this.error_line = validate_res.size;
         
-                if (this.error_line < 1) {
-                      return true;
-                }
-                var tlines = this.el.get_line_count ();
-                Gtk.TextIter iter;
-                var valiter = validate_res.map_iterator();
-                while (valiter.next()) {
-                
-            //        print("get inter\n");
-                    var eline = valiter.get_key();
-                    if (eline > tlines) {
-                        continue;
-                    }
-                    this.el.get_iter_at_line( out iter, eline);
-                    //print("mark line\n");
-                    this.el.create_source_mark(valiter.get_value(), "ERR", iter);
-                }   
-                return false;
-            }
+               if (this.error_line < 1) {
+                       return true;
+               }
+               var tlines = this.el.get_line_count ();
+               Gtk.TextIter iter;
+               var valiter = validate_res.map_iterator();
+               while (valiter.next()) {
+        
+               //        print("get inter\n");
+                       var eline = valiter.get_key();
+                       if (eline > tlines) {
+                               continue;
+                       }
+                       this.el.get_iter_at_line( out iter, eline);
+                       //print("mark line\n");
+                       this.el.create_source_mark(valiter.get_value(), "ERR", iter);
+               }   
+               return false;
+        }
         public string toString () {
             
             Gtk.TextIter s;
@@ -880,6 +1004,56 @@ public class Editor : Object
         }
     }
 
+    public class Xcls_EventControllerKey11 : Object
+    {
+        public Gtk.EventControllerKey el;
+        private Editor  _this;
+
+
+            // my vars (def)
+
+        // ctor
+        public Xcls_EventControllerKey11(Editor _owner )
+        {
+            _this = _owner;
+            this.el = new Gtk.EventControllerKey();
+
+            // my vars (dec)
+
+            // set gobject values
+
+            //listeners
+            this.el.key_released.connect( (keyval, keycode, state) => {
+            
+              
+                if (keyval == Gdk.Key.s && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
+                    GLib.debug("SAVE: ctrl-S  pressed");
+                    _this.saveContents();
+                    return;
+                }
+                
+                if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
+                   GLib.debug("SAVE: ctrl-g  pressed");
+                       _this.forwardSearch(true);
+                   return;
+               }
+               if (keyval == Gdk.Key.f && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
+                   GLib.debug("SAVE: ctrl-f  pressed");
+                       _this.search_entry.el.grab_focus();
+                   return;
+               }
+                //_this.view.el.show_completion();
+               // print(event.key.keyval)
+                
+                return;
+             
+             
+            });
+        }
+
+        // user defined functions
+    }
+
 
 
     public class Xcls_Box12 : Object
@@ -901,21 +1075,21 @@ public class Editor : Object
             // set gobject values
             this.el.homogeneous = false;
             this.el.vexpand = false;
-            var child_0 = new Xcls_search_entry( _this );
-            child_0.ref();
-            this.el.add(  child_0.el );
-            var child_1 = new Xcls_MenuBar14( _this );
+            var child_1 = new Xcls_search_entry( _this );
             child_1.ref();
-            this.el.add (  child_1.el  );
-            var child_2 = new Xcls_Button17( _this );
+            this.el.append( child_1.el );
+            var child_2 = new Xcls_search_results( _this );
             child_2.ref();
-            this.el.add(  child_2.el );
-            var child_3 = new Xcls_Button19( _this );
+            this.el.append( child_2.el );
+            var child_3 = new Xcls_nextBtn( _this );
             child_3.ref();
-            this.el.add(  child_3.el );
-            var child_4 = new Xcls_MenuButton21( _this );
+            this.el.append( child_3.el );
+            var child_4 = new Xcls_backBtn( _this );
             child_4.ref();
-            this.el.add(  child_4.el );
+            this.el.append( child_4.el );
+            var child_5 = new Xcls_MenuButton18( _this );
+            child_5.ref();
+            this.el.append( child_5.el );
         }
 
         // user defined functions
@@ -927,6 +1101,7 @@ public class Editor : Object
 
 
             // my vars (def)
+        public Gtk.CssProvider css;
 
         // ctor
         public Xcls_search_entry(Editor _owner )
@@ -938,74 +1113,24 @@ public class Editor : Object
             // my vars (dec)
 
             // set gobject values
-            this.el.width_request = 300;
+            this.el.name = "editor-search-entry";
             this.el.hexpand = true;
             this.el.placeholder_text = "Press enter to search";
-
-            // init method
-
-            var description =   Pango.FontDescription.from_string("monospace");
-               description.set_size(8000);
-                this.el.override_font(description);
+            this.el.search_delay = 3;
+            var child_1 = new Xcls_EventControllerKey14( _this );
+            child_1.ref();
+            this.el.add_controller(  child_1.el );
 
             //listeners
-            this.el.key_press_event.connect( (event) => {
-                 if (event.keyval == Gdk.Key.g && (event.state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
-                   GLib.debug("SAVE: ctrl-g  pressed");
-                       _this.forwardSearch(true);
-                   return true;
-               }
-                
-              
-               if (event.keyval == Gdk.Key.Return && this.el.text.length > 0) {
-                       var res = _this.search(this.el.text);
-                       if (res > 0) {
-                               _this.search_results.el.label = "%d Matches".printf(res);
-                       } else {
-                               _this.search_results.el.label = "No Matches";
-                       }
-                       
-                   return true;
+            this.el.search_changed.connect( ( ) => {
             
-               }    
-               // print(event.key.keyval)
-               
-                return false;
+            _this.search(_this.search_entry.el.text);
+                _this.search_results.updateResults();
             
-            });
-            this.el.changed.connect( () => {
-               /*
-               if (this.el.text == "") {
-                       _this.search_results.el.hide();
-                       return;
-               }
-               var res = 0;
-               switch(_this.windowstate.state) {
-                       case WindowState.State.CODEONLY:
-                       ///case WindowState.State.CODE:
-                               // search the code being edited..
-                               res = _this.windowstate.code_editor_tab.search(this.el.text);
-                               
-                               break;
-                       case WindowState.State.PREVIEW:
-                               if (_this.windowstate.file.xtype == "Gtk") {
-                                        res = _this.windowstate.window_gladeview.search(this.el.text);
-                               } else { 
-                                        res = _this.windowstate.window_rooview.search(this.el.text);                   
-                               }
-                       
-                       
-                               break;
-               }
-               _this.search_results.el.show();
-               if (res > 0) {
-                       _this.search_results.el.label = "%d Matches".printf(res);
-               } else {
-                       _this.search_results.el.label = "No Matches";
-               }
-                       
-               */
-               
+               GLib.Timeout.add_seconds(1,() => {
+                        _this.search_results.updateResults();
+                        return false;
+                });
             });
         }
 
@@ -1037,301 +1162,252 @@ public class Editor : Object
                
         }
     }
-
-    public class Xcls_MenuBar14 : Object
+    public class Xcls_EventControllerKey14 : Object
     {
-        public Gtk.MenuBar el;
+        public Gtk.EventControllerKey el;
         private Editor  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_MenuBar14(Editor _owner )
+        public Xcls_EventControllerKey14(Editor _owner )
         {
             _this = _owner;
-            this.el = new Gtk.MenuBar();
+            this.el = new Gtk.EventControllerKey();
 
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_search_results( _this );
-            child_0.ref();
-            this.el.add (  child_0.el  );
-        }
-
-        // user defined functions
-    }
-    public class Xcls_search_results : Object
-    {
-        public Gtk.ImageMenuItem el;
-        private Editor  _this;
-
-
-            // my vars (def)
-        public Xcls_ValaCompileErrors popup;
-
-        // ctor
-        public Xcls_search_results(Editor _owner )
-        {
-            _this = _owner;
-            _this.search_results = this;
-            this.el = new Gtk.ImageMenuItem();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.always_show_image = true;
-            this.el.label = "Matches";
-            var child_0 = new Xcls_Image16( _this );
-            child_0.ref();
-            this.el.set_image (  child_0.el  );
 
             //listeners
-            this.el.button_press_event.connect( () => {
-            /*
-                if (this.popup == null) {
-                    this.popup = new Xcls_ValaCompileErrors();
-                    this.popup.window = _this;
-                }
-               
+            this.el.key_pressed.connect( (keyval, keycode, state) => {
+            
+               if (keyval == Gdk.Key.g && (state & Gdk.ModifierType.CONTROL_MASK ) > 0 ) {
+                   GLib.debug("SAVE: ctrl-g  pressed");
+                       _this.forwardSearch(true);
+                   return true;
+               }
                 
-                this.popup.show(this.notices, this.el);
-                */
-                return true;
+              
+               if (keyval == Gdk.Key.Return && _this.search_entry.el.text.length > 0) {
+                       _this.forwardSearch(true);
+                       
+                       
+                   return true;
+            
+               }    
+               // print(event.key.keyval)
+               
+                return false;
             });
         }
 
         // user defined functions
     }
-    public class Xcls_Image16 : Object
+
+
+    public class Xcls_search_results : Object
     {
-        public Gtk.Image el;
+        public Gtk.Label el;
         private Editor  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_Image16(Editor _owner )
+        public Xcls_search_results(Editor _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Image();
+            _this.search_results = this;
+            this.el = new Gtk.Label( "No Results" );
 
             // my vars (dec)
 
             // set gobject values
-            this.el.icon_name = "system-search";
-            this.el.sensitive = false;
+            this.el.margin_end = 4;
+            this.el.margin_start = 4;
         }
 
         // user defined functions
+        public void updateResults () {
+               this.el.visible = true;
+               
+               var res = _this.searchcontext.get_occurrences_count();
+               if (res < 0) {
+                       _this.search_results.el.label = "??? Matches";          
+                       return;
+               }
+        
+               _this.nextBtn.el.sensitive = false;
+               _this.backBtn.el.sensitive = false;     
+        
+               if (res > 0) {
+                       _this.search_results.el.label = "%d Matches".printf(res);
+                       _this.nextBtn.el.sensitive = true;
+                       _this.backBtn.el.sensitive = true;
+                       return;
+               } 
+               _this.search_results.el.label = "No Matches";
+               
+        }
     }
 
-
-
-    public class Xcls_Button17 : Object
+    public class Xcls_nextBtn : Object
     {
         public Gtk.Button el;
         private Editor  _this;
 
 
             // my vars (def)
+        public bool always_show_image;
 
         // ctor
-        public Xcls_Button17(Editor _owner )
+        public Xcls_nextBtn(Editor _owner )
         {
             _this = _owner;
+            _this.nextBtn = this;
             this.el = new Gtk.Button();
 
             // my vars (dec)
+            this.always_show_image = true;
 
             // set gobject values
-            this.el.always_show_image = true;
-            this.el.label = "Next";
-            var child_0 = new Xcls_Image18( _this );
-            child_0.ref();
-            this.el.image = child_0.el;
+            this.el.icon_name = "go-down";
+            this.el.sensitive = false;
 
             //listeners
-            this.el.button_press_event.connect( (event) => {
+            this.el.clicked.connect( (event) => {
             
                _this.forwardSearch(true);
                
-               return true;
+                
             });
         }
 
         // user defined functions
     }
-    public class Xcls_Image18 : Object
-    {
-        public Gtk.Image el;
-        private Editor  _this;
-
-
-            // my vars (def)
-
-        // ctor
-        public Xcls_Image18(Editor _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Image();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.icon_name = "go-down";
-        }
-
-        // user defined functions
-    }
 
-
-    public class Xcls_Button19 : Object
+    public class Xcls_backBtn : Object
     {
         public Gtk.Button el;
         private Editor  _this;
 
 
             // my vars (def)
+        public bool always_show_image;
 
         // ctor
-        public Xcls_Button19(Editor _owner )
+        public Xcls_backBtn(Editor _owner )
         {
             _this = _owner;
+            _this.backBtn = this;
             this.el = new Gtk.Button();
 
             // my vars (dec)
+            this.always_show_image = true;
 
             // set gobject values
-            this.el.always_show_image = true;
-            this.el.label = "Previous";
-            var child_0 = new Xcls_Image20( _this );
-            child_0.ref();
-            this.el.image = child_0.el;
+            this.el.icon_name = "go-up";
+            this.el.sensitive = false;
 
             //listeners
-            this.el.button_press_event.connect( (event) => {
+            this.el.clicked.connect( (event) => {
             
                _this.backSearch(true);
-               
-               return true;
+                
             });
         }
 
         // user defined functions
     }
-    public class Xcls_Image20 : Object
-    {
-        public Gtk.Image el;
-        private Editor  _this;
-
-
-            // my vars (def)
-
-        // ctor
-        public Xcls_Image20(Editor _owner )
-        {
-            _this = _owner;
-            this.el = new Gtk.Image();
-
-            // my vars (dec)
-
-            // set gobject values
-            this.el.icon_name = "go-up";
-        }
-
-        // user defined functions
-    }
-
 
-    public class Xcls_MenuButton21 : Object
+    public class Xcls_MenuButton18 : Object
     {
         public Gtk.MenuButton el;
         private Editor  _this;
 
 
             // my vars (def)
+        public bool always_show_image;
 
         // ctor
-        public Xcls_MenuButton21(Editor _owner )
+        public Xcls_MenuButton18(Editor _owner )
         {
             _this = _owner;
             this.el = new Gtk.MenuButton();
 
             // my vars (dec)
+            this.always_show_image = true;
 
             // set gobject values
-            this.el.always_show_image = true;
-            this.el.label = "Settings";
-            var child_0 = new Xcls_Image22( _this );
-            child_0.ref();
-            this.el.image = child_0.el;
+            this.el.icon_name = "emblem-system";
+            this.el.always_show_arrow = true;
             var child_1 = new Xcls_search_settings( _this );
             child_1.ref();
-            this.el.popup = child_1.el;
+            this.el.popover = child_1.el;
         }
 
         // user defined functions
     }
-    public class Xcls_Image22 : Object
+    public class Xcls_search_settings : Object
     {
-        public Gtk.Image el;
+        public Gtk.Popover el;
         private Editor  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_Image22(Editor _owner )
+        public Xcls_search_settings(Editor _owner )
         {
             _this = _owner;
-            this.el = new Gtk.Image();
+            _this.search_settings = this;
+            this.el = new Gtk.Popover();
 
             // my vars (dec)
 
             // set gobject values
-            this.el.icon_name = "emblem-system";
+            var child_1 = new Xcls_Box20( _this );
+            child_1.ref();
+            this.el.child = child_1.el;
         }
 
         // user defined functions
     }
-
-    public class Xcls_search_settings : Object
+    public class Xcls_Box20 : Object
     {
-        public Gtk.Menu el;
+        public Gtk.Box el;
         private Editor  _this;
 
 
             // my vars (def)
 
         // ctor
-        public Xcls_search_settings(Editor _owner )
+        public Xcls_Box20(Editor _owner )
         {
             _this = _owner;
-            _this.search_settings = this;
-            this.el = new Gtk.Menu();
+            this.el = new Gtk.Box( Gtk.Orientation.VERTICAL, 0 );
 
             // my vars (dec)
 
             // set gobject values
-            var child_0 = new Xcls_case_sensitive( _this );
-            child_0.ref();
-            this.el.append(  child_0.el );
-            var child_1 = new Xcls_regex( _this );
+            var child_1 = new Xcls_case_sensitive( _this );
             child_1.ref();
-            this.el.append(  child_1.el );
-            var child_2 = new Xcls_multiline( _this );
+            this.el.append( child_1.el );
+            var child_2 = new Xcls_regex( _this );
             child_2.ref();
-            this.el.append(  child_2.el );
+            this.el.append( child_2.el );
+            var child_3 = new Xcls_multiline( _this );
+            child_3.ref();
+            this.el.append( child_3.el );
         }
 
         // user defined functions
     }
     public class Xcls_case_sensitive : Object
     {
-        public Gtk.CheckMenuItem el;
+        public Gtk.CheckButton el;
         private Editor  _this;
 
 
@@ -1342,7 +1418,7 @@ public class Editor : Object
         {
             _this = _owner;
             _this.case_sensitive = this;
-            this.el = new Gtk.CheckMenuItem();
+            this.el = new Gtk.CheckButton();
 
             // my vars (dec)
 
@@ -1361,7 +1437,7 @@ public class Editor : Object
 
     public class Xcls_regex : Object
     {
-        public Gtk.CheckMenuItem el;
+        public Gtk.CheckButton el;
         private Editor  _this;
 
 
@@ -1372,7 +1448,7 @@ public class Editor : Object
         {
             _this = _owner;
             _this.regex = this;
-            this.el = new Gtk.CheckMenuItem();
+            this.el = new Gtk.CheckButton();
 
             // my vars (dec)
 
@@ -1391,7 +1467,7 @@ public class Editor : Object
 
     public class Xcls_multiline : Object
     {
-        public Gtk.CheckMenuItem el;
+        public Gtk.CheckButton el;
         private Editor  _this;
 
 
@@ -1402,18 +1478,12 @@ public class Editor : Object
         {
             _this = _owner;
             _this.multiline = this;
-            this.el = new Gtk.CheckMenuItem();
+            this.el = new Gtk.CheckButton();
 
             // my vars (dec)
 
             // set gobject values
             this.el.label = "Multi-line (add \\n)";
-
-            // init method
-
-            {
-               this.el.show();
-            }
         }
 
         // user defined functions
@@ -1422,4 +1492,5 @@ public class Editor : Object
 
 
 
+
 }