Packages
Packages copied to clipboard
[C++] #if 0 marks section as a comment until #endif
- Sublime Version: 3.2.2 build 3211
- OS Version: Kubuntu 20.04
#if 0
#define X 1
#elif ABC == 1
#define X 2
#else
#define X 3
#endif
In the above code, Sublime marks the whole block between #if and #endif as a comment, while it should only mark the code up until the next #elif or #else. In case of #elif, it should probably re-evaluate the condition for 0, as it does for #if, and mark the next subsection until the next #elif or #else as a comment. And so on.
https://github.com/sublimehq/Packages/blob/f36b8f807d5f30d2b8ef639232a9fc5960f550fa/C%2B%2B/C%2B%2B.sublime-syntax#L1643-L1667

This is how it looks like with the master branch. The red-boxed part shouldn't be commented.