[vim/vim] C Highlighting for Compound Initializers and Literals inside () and [] (PR #20842)

4 views
Skip to first unread message

Boobies

unread,
Jul 25, 2026, 3:26:27 AM (3 days ago) Jul 25
to vim/vim, Subscribed

Fix for #18709

I have made the decision not to cover cases like

( (struct foo) } ) // Missing {

because while it would be nice to highlight the } when c_no_curly_error is not set, the } acts as a closing delimiter in the detection of matching parentheses and brackets. If I consume it where compound literals/initializers are allowed, the heuristic would also leave open the door for the unrelated

if ((struct foo)foo // Typo, we forgot the outer )

causing problems. In particular, I am weary of triggering long scans until we finally meet a closing brace. This sort of issue is also the whole motivation for the c_*_error toggles. So whoever wants the above error to be highlighted should use the (existing) c_curly_error to enable brace checking globally.


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

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

Commit Summary

  • a169275 runtime(c): compound literal braces are highlighted as errors

File Changes

(3 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/20842@github.com>

Boobies

unread,
Jul 26, 2026, 9:45:39 PM (yesterday) Jul 26
to vim/vim, Subscribed
Boobies left a comment (vim/vim#20842)

@bfoersterling you looked into this issue before, could you give this a test?


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/20842/c5086482911@github.com>

Reply all
Reply to author
Forward
0 new messages