From: Christian Brabandt Date: Wed, 18 Feb 2026 16:37:39 +0000 (+0100) Subject: runtime(ccomplete): handle structs from tags file X-Git-Tag: v9.2.0016~1 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=89712b9f0e8cbf6074cc5dc0465bdd62245ad9c1;p=thirdparty%2Fvim.git runtime(ccomplete): handle structs from tags file fixes: #7292 Signed-off-by: Christian Brabandt --- diff --git a/runtime/autoload/ccomplete.vim b/runtime/autoload/ccomplete.vim index cb4bb2c167..51237be98b 100644 --- a/runtime/autoload/ccomplete.vim +++ b/runtime/autoload/ccomplete.vim @@ -3,7 +3,7 @@ vim9script noclear # Vim completion script # Language: C # Maintainer: The Vim Project -# Last Change: 2025 Jul 24 +# Last Change: 2026 Feb 18 # Rewritten in Vim9 script by github user lacygoill # Former Maintainer: Bram Moolenaar @@ -489,7 +489,7 @@ def Nextitem( # {{{1 continue endif - # Use the tags file to find out if this is a typedef. + # Use the tags file to find out if this is a typedef or struct var diclist: list> = taglist('^' .. tokens[tidx] .. '$') for tagidx: number in len(diclist)->range() @@ -509,6 +509,13 @@ def Nextitem( # {{{1 continue endif + # handle struct + if item['kind'] == 's' + res = StructMembers('struct:' .. tokens[tidx], items, all) + break + endif + + # Only handle typedefs here. if item['kind'] != 't' continue @@ -733,4 +740,4 @@ def SearchMembers( # {{{1 enddef #}}}1 -# vim: noet sw=2 sts=2 +# vim: et sw=2 sts=2