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
L(very)GTM. Tested #2657 without this PR and with and the change fixes the symbol list restore.
This pull request is not obsoleted by #3055, closing
Closed #3050.
"Now" obsoleted?
"Now" obsoleted?
Yep :-).
github-comments@lists.geany.org