The current code assumes that the whole `var_type` string consists of the anonymous type name. This works for simple cases like ``` struct {} X; ``` where `X` is of the type `__anonXXXX` but not for cases like ``` struct {} X[2]; ``` where `X` is of type `__anonXXXX[]`.
For these cases checking for equality of `var_tag->var_type`, `orig_name` isn't sufficient and we have to check whether `orig_name` is a substring of `var_tag->var_type` and replace this substring with the new anon name.
This problem can be seen for instance in the symbol tree tooltip of the `symbols_icons` variable inside `symbols.c`. You can view, comment on, or merge this pull request online at:
https://github.com/geany/geany/pull/3273
-- Commit Summary --
* Fix renaming tag type containing anonymous type
-- File Changes --
M src/tagmanager/tm_ctags.c (12)
-- Patch Links --
https://github.com/geany/geany/pull/3273.patch https://github.com/geany/geany/pull/3273.diff
Looks good and works. Thanks!
Merged #3273 into master.
github-comments@lists.geany.org