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

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

index 408f5a0..62a7daf 100644 (file)
@@ -16,7 +16,7 @@
    "# int pos_root_y" : "",
    "# string ptype" : "\"\"",
    "bool expand" : true,
-   "| void showPlainFile" : "(string fname)\n{\n    this.ptype = \"\";\n    this.key  = \"\";\n    this.node = null;\n    this.file = null;\n    string str;\n    try {\n        GLib.FileUtils.get_contents(fname, out str);\n    } catch (Error e) {\n        str = \"\"; // a tad dangerios... - perhaps we should block editing...\n    }\n    \n    this.view.load(str);\n    this.key_edit.el.text = \"\";    \n\n}",
+   "| void showPlainFile" : "(string fname)\n{\n    this.ptype = \"\";\n    this.key  = \"\";\n    this.node = null;\n    this.file = null;\n    this.fname = fname;\n    string str;\n    try {\n        GLib.FileUtils.get_contents(fname, out str);\n    } catch (Error e) {\n        str = \"\"; // a tad dangerios... - perhaps we should block editing...\n    }\n    \n    this.view.load(str);\n    this.key_edit.el.text = \"\";    \n\n}",
    "# string key" : "\"\"",
    "* pack" : "add",
    "xtype" : "Box",
index a40f1de..851d2cd 100644 (file)
@@ -116,6 +116,7 @@ public class Editor : Object
         this.key  = "";
         this.node = null;
         this.file = null;
+        this.fname = fname;
         string str;
         try {
             GLib.FileUtils.get_contents(fname, out str);