Branch: refs/heads/master Author: Jiří Techet techet@gmail.com Committer: Jiří Techet techet@gmail.com Date: Mon, 29 Aug 2022 17:35:46 UTC Commit: 10fba80d84fa940c10f193bc351f96e2cc32d92b https://github.com/geany/geany/commit/10fba80d84fa940c10f193bc351f96e2cc32d9...
Log Message: ----------- Ignore local tags for autocompletion in other files
ctags sets the tag's "local" flag to true for tags whose visibility is limited to the current file only. These are for instance "static" functions in C.
We can ignore these tags for autocompletion in other files than the tag's file which reduces the number of irrelevant tags in the autocompletion popup.
Modified Paths: -------------- src/tagmanager/tm_workspace.c
Modified: src/tagmanager/tm_workspace.c 7 lines changed, 6 insertions(+), 1 deletions(-) =================================================================== @@ -637,7 +637,12 @@ gboolean tm_workspace_is_autocomplete_tag(TMTag *tag, (current_file == tag->file && current_line >= tag->line && g_strcmp0(current_scope, tag->scope) == 0); - return valid && !tm_tag_is_anon(tag) && tm_parser_langs_compatible(lang, tag->lang); + + /* tag->local indicates per-file-only visibility such as static C functions */ + gboolean valid_local = !tag->local || current_file == tag->file; + + return valid && valid_local && + !tm_tag_is_anon(tag) && tm_parser_langs_compatible(lang, tag->lang); }
-------------- This E-Mail was brought to you by github_commit_mail.py (Source: https://github.com/geany/infrastructure).