Re: [vim/vim] Runtime (c) - fix compound literals and struct initializers (PR #20451)

2 views
Skip to first unread message

Christian Brabandt

unread,
Jun 8, 2026, 3:00:13 PM (10 hours ago) Jun 8
to vim/vim, Subscribed
chrisbra left a comment (vim/vim#20451)

Thanks. can some people test this? @bogdan-barbu @dzwdz ?


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!
You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20451/c4652397129@github.com>

bfoersterling

unread,
Jun 8, 2026, 4:01:52 PM (9 hours ago) Jun 8
to vim/vim, Subscribed

Problem

Compound literals and struct initializers in .c files are highlighted as errors, when they are inside parenthesis.

Currently in .c files curly brackets inside parenthesis seem to be categorized as
cErrInParen in general.

Solution

Allow curly braces inside parenthesis and add new syntax group cCompoundLiteral so that compound literals are not inside cBadBlock group.
I did not add a syntax group for struct initializers though, as this was not my primary focus.
So struct initializers are still inside cBadBlock group.
But as this group is transparent it will not be highlighted as an error.
The example code in the issue (that is included as a test in the PR) will not have a highlighted error anymore.

closes: #18709


You can view, comment on, or merge this pull request online at:

  https://github.com/vim/vim/pull/20451

Commit Summary

  • 78b3e3f Runtime(c) - fix compound literals

File Changes

(5 files)

Patch Links:


Reply to this email directly, view it on GitHub, or unsubscribe.
Triage notifications, keep track of coding agent tasks and review pull requests on the go with GitHub Mobile for iOS and Android. Download it today!

You are receiving this because you are subscribed to this thread.Message ID: <vim/vim/pull/20451@github.com>

Reply all
Reply to author
Forward
0 new messages