Sublime Forum

C++: broken structure detection after unstructured nesting

#1

Hello,

Browsing the Qt 4.8.6 sources I’ve found that many methods were not detected in the goto command popup (ctrl+p, @). Looking at the file’s highlighting, it seems that an unstructured nesting of an #ifndef statement and an if statement is breaking syntax highlighting -and, I assume, structure detection as well- from that point onwards. An example of the offending code is at line 1479 of qlineedit.cpp in the Qt 4.8.6 source code.

I have no experience in c++ so I’ve got no idea if this kind of unstructured nesting of compiler directives and control structures is considered good coding practice, but even if it’s not you might agree that if there is such code out there in the wild (and in such a widely used source as the qt toolkit), it would be nice to have Sublime Text handle it gracefully.

I’m using ST 3, build 3062, Dev Channel.

I attach an image of the issue. Couldn’t upload qlineedit.cpp from Qt sources src/gui/widgets folder because this forum doesn’t allow the extension cpp!

Thanks!

http://imgur.com/ZNnacTm

0 Likes