]> git.ipfire.org Git - thirdparty/vim.git/commitdiff
runtime(ccomplete): handle structs from tags file
authorChristian Brabandt <cb@256bit.org>
Wed, 18 Feb 2026 16:37:39 +0000 (17:37 +0100)
committerChristian Brabandt <cb@256bit.org>
Wed, 18 Feb 2026 16:39:01 +0000 (17:39 +0100)
fixes: #7292

Signed-off-by: Christian Brabandt <cb@256bit.org>
runtime/autoload/ccomplete.vim

index cb4bb2c16701b95b8d165ff4f814ff9f9b53bcc2..51237be98b4ef7dfd37a9b0295bc5d8377a60449 100644 (file)
@@ -3,7 +3,7 @@ vim9script noclear
 # Vim completion script
 # Language:    C
 # Maintainer:  The Vim Project <https://github.com/vim/vim>
-# Last Change: 2025 Jul 24
+# Last Change: 2026 Feb 18
 #              Rewritten in Vim9 script by github user lacygoill
 # Former Maintainer:   Bram Moolenaar <Bram@vim.org>
 
@@ -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<dict<any>> = 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