src/Builder4/Editor.bjs
[app.Builder.js] / src / Builder4 / Editor.vala
index 17db5fa..9394266 100644 (file)
@@ -263,6 +263,7 @@ public class Editor : Object
             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;
             this.el.highlight_current_line = true;
             var child_0 = new Xcls_buffer( _this );
             child_0.ref();
@@ -346,14 +347,19 @@ public class Editor : Object
             if (_this.file != null) {
                  lang = _this.file.language;
             }
-            
-         
-            ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(
-                    _this.file.content_type.length > 0  ?
+            print("lang=%s, content_type = %s\n", lang, _this.file.content_type);
+            var lg = _this.file.content_type.length > 0  ?
                     lm.guess_language(_this.file.path, _this.file.content_type) :
-                    lm.get_language(lang)
-                );
-         
+                    lm.get_language(lang);
+            
+           
+           
+            ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lg); 
+        
+            this.el.insert_spaces_instead_of_tabs = true;
+            if (lg.name == "vala") {
+                this.el.insert_spaces_instead_of_tabs = false;
+            }
              
             _this.dirty = false;
             this.el.grab_focus();
@@ -512,16 +518,13 @@ public class Editor : Object
             // clear the buttons.
          
             
-           if (! p.validateVala(
-                _this.window.windowstate,
-                str, 
-                 _this.key, 
-                _this.ptype,
+           if (! _this.window.windowstate.valasource.checkFileWithNodePropChange(
                 _this.file,
-                _this.node 
-                
-                
-            )) {
+                _this.node,
+                 _this.key,        
+                 _this.ptype,
+                    str
+                )) {
                 this.check_running = false;
             }