src/Builder4/Editor.bjs
authorAlan <alan@roojs.com>
Wed, 27 Mar 2024 10:04:54 +0000 (18:04 +0800)
committerAlan <alan@roojs.com>
Wed, 27 Mar 2024 10:04:54 +0000 (18:04 +0800)
src/Builder4/Editor.vala

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

index b23e025..ca520d6 100644 (file)
             "\t\t_this.navigation_holder.el.show();",
             "\t\t_this.paned.el.position  = ",
             "\t\t\t_this.paned.el.get_width() - 200;",
-            "\t}",
+            "\t} ",
             "\t//_this.navliststore.el.remove_all();",
             "\t",
             "\t",
             "\tforeach(var sym in syms) {",
             "\t\tls.append(sym);",
             "\t}",
+            "\t// if syms updated is empty, but we already have one..",
+            "\tif (_this.navliststore.el.get_n_items() > 0 && ls.get_n_items < 1) {",
+            "\t\treturn;",
+            "\t}",
             "\tLsp.DocumentSymbol.copyList(ls, _this.navliststore.el);",
             "\t//_this.navliststore.el.append(sym);",
             "\tthis.last_selected_line = -1;",
index 1aa0ff0..97acb03 100644 (file)
@@ -2046,7 +2046,7 @@ public class Editor : Object
                                _this.navigation_holder.el.show();
                                _this.paned.el.position  = 
                                        _this.paned.el.get_width() - 200;
-                       }
+                       } 
                        //_this.navliststore.el.remove_all();
                        
                        
@@ -2055,6 +2055,10 @@ public class Editor : Object
                        foreach(var sym in syms) {
                                ls.append(sym);
                        }
+                       // if syms updated is empty, but we already have one..
+                       if (_this.navliststore.el.get_n_items() > 0 && ls.get_n_items < 1) {
+                               return;
+                       }
                        Lsp.DocumentSymbol.copyList(ls, _this.navliststore.el);
                        //_this.navliststore.el.append(sym);
                        this.last_selected_line = -1;