expand current file in errors.
authorAlan <alan@roojs.com>
Tue, 19 Jul 2022 09:51:51 +0000 (17:51 +0800)
committerAlan <alan@roojs.com>
Tue, 19 Jul 2022 09:51:51 +0000 (17:51 +0800)
src/Builder4/ValaCompileErrors.bjs
src/Builder4/ValaCompileErrors.vala
src/Builder4/WindowState.vala

index 1d61a3c..f1aa077 100644 (file)
     "        \t3, file,",
     "    \t-1);",
     "        ",
+    "        if (this.window.windowstate.file.path == file) {",
+    "        ",
+    "        \t_this.compile_tree.el.expand_row(   store.get_path(iter) , true);",
+    "        ",
+    "        }",
+    "        ",
+    "        ",
     "        lines.foreach_member((obja, line, nodea) => {",
     "            var msg  = \"\";",
     "            var ar = lines.get_array_member(line);",
     "\t\t    print(\"Add line %s\", line);",
     "\t\t    store.append(out citer, iter);",
     "\t\t    store.set(citer, ",
-    "\t\t            0, file + \":\" + line, ",
+    "\t\t            0, file + \":\" + int.parse(line).to_string(\"%09d\"), ",
     "\t\t            1, int.parse(line), ",
     "\t\t            2, GLib.Markup.escape_text(line + \": \" + msg), ",
     "\t\t            3, file, ",
index 4f11416..f3cdb99 100644 (file)
@@ -76,6 +76,13 @@ public class Xcls_ValaCompileErrors : Object
                3, file,
                -1);
             
+            if (this.window.windowstate.file.path == file) {
+            
+               _this.compile_tree.el.expand_row(   store.get_path(iter) , true);
+            
+            }
+            
+            
             lines.foreach_member((obja, line, nodea) => {
                 var msg  = "";
                 var ar = lines.get_array_member(line);
@@ -87,7 +94,7 @@ public class Xcls_ValaCompileErrors : Object
                    print("Add line %s", line);
                    store.append(out citer, iter);
                    store.set(citer, 
-                           0, file + ":" + line
+                           0, file + ":" + int.parse(line).to_string("%09d")
                            1, int.parse(line), 
                            2, GLib.Markup.escape_text(line + ": " + msg), 
                            3, file, 
index dc20a22..1a76bde 100644 (file)
@@ -42,7 +42,6 @@ public class WindowState : Object
        public DialogTemplateSelect template_select; 
        
        public Xcls_PopoverFileDetails file_details;
-        
        public Xcls_ValaCompileResults compile_results;
        
        // dialogs??