-
-
Notifications
You must be signed in to change notification settings - Fork 5.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
The default syntax file for C doesn't handle compound literals #406
Comments
I think, this can be avoided by reseting some configuration variables, it looks like setting |
That doesn't fix the issue; it hides it by turning off highlighting of bracket errors. Why disable highlighting of all possible bracket errors that would be highlighted just because one language feature isn't understood? |
I just bumped into this problem too. This issue should be reopened. @chrisbra - this issue should addressed. |
A { inside () is highlighted to be able to spot a missing ). If you can suggest changing the syntax to still highlight a { inside () without highlighting a legal {, let's see it. |
I didn't mean I can provide the solution, I just said that this is a bug that is still unsolved (thus it's weird to leave it "closed"). With compound literals it's legal to have On the other hand, if you say it won't be possible because of vim's internals, then it's different, and I won't argue. After all, I'm just an end-user. |
Please file the bug with the maintainers of the C standard. The syntax they created is impossible to parse in a simple way. OK, so that won't solve the problem either. But it's true, the C syntax has gotten so complicated you can't really figure out what it means with regular expressions. And also for humans, I have a hard time understanding the example. Splitting into two lines helps for both: This issue is closed because it can't be fixed. Unless someone proves me wrong. |
@brammool Making
Figure brace error highlighting is not helpful for most users I know. |
|
It seems to not happen in: |
Problem: A getchar() call while executing a register resets the reg_executing() result. Solution: Save and restore reg_executing. (closes #406
Problem: A getchar() call while executing a register resets the reg_executing() result. Solution: Save and restore reg_executing. (closes vim/vim#406 vim/vim@f0fab30
The current default syntax file for C does not support the standard C syntax for compound literals.
See the image attached below.
The curly brace is highlighted as though there were a syntax error, but in fact the code is perfectly legitimate and compiles under any conforming C99 or C11 implementation.
The default syntax file for C ought to handle this correctly.
The text was updated successfully, but these errors were encountered: