[Github-comments] [geany/geany] Fix setting parents in symbol tree when filtering is used (PR #3050)

Jiří Techet notifications at xxxxx
Thu Dec 9 17:26:18 UTC 2021


This patch fixes symbol tree construction when #2657 is applied.

When a filter for tags is used for the symbol tree, it may happen that
parent tags in the symbol tree are removed because they don't match
the filter. Such tags are still visualised nicely by the symbol tree
which shows these tags with full scope like

```
MissingStruct::some_member
```

However, the current code doesn't expect that it may happen that
`MissingStruct` re-appears in the results when filter is deleted. In such
case `some_member` isn't re-parented under `MissingStruct` and stays
displayed in the above format.

This patch simply removes tags like `MissingStruct::some_member` for
which parent hasn't been constructed yet from the symbol tree and re-adds
them in the "insertion pass" for the symbol tree update code.

The only change this patch does is that it replaces
```
if (parent_name && ! g_hash_table_lookup(parents_table, parent_name))
    parent_name = NULL;
```
with
```
if (parent_name && ! g_hash_table_lookup(parents_table, parent_name))
    cont = tree_store_remove_row(store, &iter);
else
{
```
The rest is just indentation after the `else`.
You can view, comment on, or merge this pull request online at:

  https://github.com/geany/geany/pull/3050

-- Commit Summary --

  * Fix setting parents in symbol tree when filtering is used

-- File Changes --

    M src/symbols.c (50)

-- Patch Links --

https://github.com/geany/geany/pull/3050.patch
https://github.com/geany/geany/pull/3050.diff

-- 
You are receiving this because you are subscribed to this thread.
Reply to this email directly or view it on GitHub:
https://github.com/geany/geany/pull/3050
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.geany.org/pipermail/github-comments/attachments/20211209/7ecdd0a3/attachment-0001.htm>


More information about the Github-comments mailing list