src/Builder4/Editor.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 28 May 2015 06:31:16 +0000 (14:31 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 28 May 2015 06:31:16 +0000 (14:31 +0800)
src/Builder4/Editor.vala

src/Builder4/Editor.bjs
src/Builder4/Editor.vala

index b23ce45..5deafd6 100644 (file)
@@ -72,7 +72,7 @@
        "gboolean highlight_current_line" : true,
        "$ gboolean auto_indent" : true,
        "$ xns" : "Gtk",
-       "|   void load" : " (string str) {\n\n// show the help page for the active node..\n   //this.get('/Help').show();\n\n\n  // this.get('/BottomPane').el.set_current_page(0);\n    var buf = (Gtk.SourceBuffer)this.el.get_buffer();\n    buf.set_text(str, str.length);\n    buf.set_undo_manager(null);\n    \n    var lm = Gtk.SourceLanguageManager.get_default();\n    var lang = \"vala\";\n    if (_this.file != null) {\n         lang = _this.file.language;\n    }\n    print(\"lang=%s, content_type = %s\\n\", lang, _this.file.content_type);\n    var lg = _this.file.content_type.length > 0  ?\n            lm.guess_language(_this.file.path, _this.file.content_type) :\n            lm.get_language(lang);\n    \n   \n   \n    ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lg); \n    \n    if (lg.name == \"vala\") {\n        this.el.insert_spaces_instead_of_tabs = false;\n    }\n     \n    _this.dirty = false;\n    this.el.grab_focus();\n    _this.save_button.el.sensitive = false;\n}",
+       "|   void load" : " (string str) {\n\n// show the help page for the active node..\n   //this.get('/Help').show();\n\n\n  // this.get('/BottomPane').el.set_current_page(0);\n    var buf = (Gtk.SourceBuffer)this.el.get_buffer();\n    buf.set_text(str, str.length);\n    buf.set_undo_manager(null);\n    \n    var lm = Gtk.SourceLanguageManager.get_default();\n    var lang = \"vala\";\n    if (_this.file != null) {\n         lang = _this.file.language;\n    }\n    print(\"lang=%s, content_type = %s\\n\", lang, _this.file.content_type);\n    var lg = _this.file.content_type.length > 0  ?\n            lm.guess_language(_this.file.path, _this.file.content_type) :\n            lm.get_language(lang);\n    \n   \n   \n    ((Gtk.SourceBuffer)(this.el.get_buffer())) .set_language(lg); \n\n    this.el.insert_spaces_instead_of_tabs = true;\n    if (lg.name == \"vala\") {\n        this.el.insert_spaces_instead_of_tabs = false;\n    }\n     \n    _this.dirty = false;\n    this.el.grab_focus();\n    _this.save_button.el.sensitive = false;\n}",
        "bool insert_spaces_instead_of_tabs" : true,
        "indent_width" : 4,
        "$ show_line_numbers" : true,
index 30b0036..83e85ce 100644 (file)
@@ -354,7 +354,8 @@ public class Editor : Object
            
            
             ((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;
             }