src/Builder4/Editor.bjs
authorAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2024 13:58:28 +0000 (21:58 +0800)
committerAlan Knowles <alan@roojs.com>
Thu, 21 Mar 2024 13:58:28 +0000 (21:58 +0800)
src/Builder4/Editor.vala

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

index 484968a..31990ce 100644 (file)
          "| void show" : [
           "(Gee.ArrayList<Lsp.DocumentSymbol> syms) {",
           "\t_this.navigationwindow.el.show();",
-          "\t_this.navliststore.el.remove_all();",
+          "\t//_this.navliststore.el.remove_all();",
+          "\t",
+          "\t",
+          "\tvar ls  = new GLib.ListStore(typeof(Lsp.DocumentSymbol));",
+          "\t",
           "\tforeach(var sym in syms) {",
-          "\t\t_this.navliststore.el.append(sym);",
+          "\t\tls.append(sym);",
           "\t}",
+          "\tLsp.DocumentSymbol.copyList(ls, _this.navliststore.el);",
+          "\t//_this.navliststore.el.append(sym);",
           "\tthis.last_selected_line = -1;",
           "\tGLib.Idle.add(() => {",
           "",
index afabae3..706acd2 100644 (file)
@@ -1848,10 +1848,16 @@ public class Editor : Object
                 }
                public void show (Gee.ArrayList<Lsp.DocumentSymbol> syms) {
                        _this.navigationwindow.el.show();
-                       _this.navliststore.el.remove_all();
+                       //_this.navliststore.el.remove_all();
+                       
+                       
+                       var ls  = new GLib.ListStore(typeof(Lsp.DocumentSymbol));
+                       
                        foreach(var sym in syms) {
-                               _this.navliststore.el.append(sym);
+                               ls.append(sym);
                        }
+                       Lsp.DocumentSymbol.copyList(ls, _this.navliststore.el);
+                       //_this.navliststore.el.append(sym);
                        this.last_selected_line = -1;
                        GLib.Idle.add(() => {