Kyku wrote:

> Ok, using the old saying "Use the force, read the source" I browsed 
> ccomplete.vim a little. If I knew Vim scripting a little, I'd do the 
> following:
> 
> After line 406:
>   if we're dealing with C++ file:
>     if item['kind'] is 'c', 'u' or 's':
>        kind2name = {'c': 'class', 'u': 'union', 's': 'struct'}
>        call StructMembers for kind2name[item['kind']] . ':' . tokens[tidx]
> 
> That should do the trick. What do you think?

I don't think this gives good results.  A name can be defined in several
ways with different types.  If you omit the "struct" like you did in
your first example it is not valid C and completion _should_ fail.  I
don't know why C++ would allow this, looks like a bug to me (so do many
others things in C++ :-).

-- 
You were lucky. We lived for three months in a brown paper bag in a 
septic tank. We used to have to get up at six o'clock in the morning, 
clean the bag, eat a crust of stale bread, go to work down mill for 
fourteen hours a day week in-week out. When we got home, our Dad
would thrash us to sleep with his belt!

 /// Bram Moolenaar -- [EMAIL PROTECTED] -- http://www.Moolenaar.net   \\\
///        sponsor Vim, vote for features -- http://www.Vim.org/sponsor/ \\\
\\\        download, build and distribute -- http://www.A-A-P.org        ///
 \\\            help me help AIDS victims -- http://www.ICCF.nl         ///

Reply via email to