src/Builder4/Editor.bjs
authorAlan Knowles <alan@roojs.com>
Wed, 27 May 2015 08:12:02 +0000 (16:12 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 27 May 2015 08:12:02 +0000 (16:12 +0800)
src/Builder4/Editor.vala

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

index 8ee53d5..ccba076 100644 (file)
@@ -9,7 +9,7 @@
  "items" : [
   {
    "# Xcls_MainWindow window" : "null",
-   "|   bool saveContents" : "  ()  {\n    \n    \n    if (_this.file == null) {\n        return true;\n    }\n    \n    \n    \n    \n   \n     \n     var str = _this.buffer.toString();\n     \n      \n     \n     \n     if (!_this.buffer.checkSyntax()) {\n         print(\"check syntax failed\");\n         //this.get('/StandardErrorDialog').show(\"Fix errors in code and save..\"); \n         //return false;\n     }\n     \n     // LeftPanel.model.changed(  str , false);\n     _this.dirty = false;\n     _this.save_button.el.sensitive = false;\n     \n     \n        \n     \n    // find the text for the node..\n    if (ptype == \"listener\") {\n        this.node.listeners.set(key,str);\n    \n    } else {\n         this.node.props.set(key,str);\n    }\n\n     \n    \n    // call the signal..\n    this.save();\n    \n    return true;\n\n} ",
+   "|   bool saveContents" : "  ()  {\n    \n    \n    if (_this.file == null) {\n        return true;\n    }\n    \n    \n    \n    \n   \n     \n     var str = _this.buffer.toString();\n     \n     _this.buffer.checkSyntax();\n     \n     \n     \n     // LeftPanel.model.changed(  str , false);\n     _this.dirty = false;\n     _this.save_button.el.sensitive = false;\n     \n    // find the text for the node..\n    if (_this.file.xtype != \"PlainFile\") {\n        if (ptype == \"listener\") {\n            this.node.listeners.set(key,str);\n        \n        } else {\n             this.node.props.set(key,str);\n        }\n    }\n     \n    \n    // call the signal..\n    this.save();\n    \n    return true;\n\n} ",
    "# string activeEditor" : "\"\"",
    "# int pos_root_x" : "",
    "# int pos_root_y" : "",
index 63980fc..07b8417 100644 (file)
@@ -74,30 +74,23 @@ public class Editor : Object
          
          var str = _this.buffer.toString();
          
-          
+         _this.buffer.checkSyntax();
          
          
-         if (!_this.buffer.checkSyntax()) {
-             print("check syntax failed");
-             //this.get('/StandardErrorDialog').show("Fix errors in code and save.."); 
-             //return false;
-         }
          
          // LeftPanel.model.changed(  str , false);
          _this.dirty = false;
          _this.save_button.el.sensitive = false;
          
-         
-            
-         
         // find the text for the node..
-        if (ptype == "listener") {
-            this.node.listeners.set(key,str);
-        
-        } else {
-             this.node.props.set(key,str);
+        if (_this.file.xtype != "PlainFile") {
+            if (ptype == "listener") {
+                this.node.listeners.set(key,str);
+            
+            } else {
+                 this.node.props.set(key,str);
+            }
         }
-    
          
         
         // call the signal..