Re: c_no_curly_error doesn't seem to work with nested braces

47 views
Skip to first unread message

William Budd

unread,
Apr 29, 2013, 9:23:17 PM4/29/13
to vim...@vim.org
> Hi! The following example contains a valid C99 (and C11) compound literal:
>
> post(
> letter,
> &(struct envelope){
> .stamp = {
> .value = ONE_CENT,
> .pic = RAT
> },
> .address = &address
> }
> );
>
> Yet even after setting "let c_no_curly_error = 1", the last closing
> parenthesis remains highlighted in red as if it were an error.
>
> However, if I remove the ".stamp = { ... }" struct member, the
> highlight disappears, so it seems to me that c_no_curly_error can only
> ignore un-nested pairs of braces within any given pair of parentheses.
>
> Can this be fixed and/or is there a workaround? I wouldn't mind
> disabling parentheses-related error checking all together, should that
> be what it takes.

Sending this to vim-dev since I got no reply on the vim user list, and
because I guess it's fair to call the above a bug (vim 7.3.875).

I considered sending a patch of syntax/c.vim, but given that file's
complexity, chances are I'd end up breaking something without even
noticing. Would be happy if a dev could take a look.

Thanks,
Will

Tony Mechelynck

unread,
Apr 30, 2013, 2:11:13 AM4/30/13
to vim...@googlegroups.com
syntax/c.vim is by Bram Moolenaar, and AFAIK he reads both vim_use and
vim_dev; but he has a full-time job (well, minus one day per week by
which Google sponsorizes Vim), and I think he is quite busy, even when
he isn't visiting the Kibaale project in Uganda.


Best regards,
Tony.
--
If an S and an I and an O and a U
With an X at the end spell Su;
And an E and a Y and an E spell I,
Pray what is a speller to do?
Then, if also an S and an I and a G
And an HED spell side,
There's nothing much left for a speller to do
But to go commit siouxeyesighed.
-- Charles Follen Adams, "An Orthographic Lament"

Reply all
Reply to author
Forward
0 new messages