Sublime Forum

C syntax detection fails when there is a newline between a function name and the open-paren

#1

It looks like Sublime Text 3’s C syntax lexer does not like it when there is a newline between the method name and the opening paren.

In the below example, notokay does not get syntax highlighted as a method, and does not show in the Commadn-R “Goto Symbol” output (screenshot attached). I expect this is a result of a regex expecting the paren on the same line.

void okay1();

void okay2() 
{}

void okay3(
    int foo
) {

}

void notokay
()
{}

void okay4(){}
0 Likes

#2

22%20PM

0 Likes

#3

It seems to work fine here out of the box in ST 3211 and 4086:

image

image

Do you have a third party syntax installed? Your Goto Anything results don’t look like they’re styled in a standard way.

0 Likes

#4

That’s it! I have “C Improved” installed and it’s messing with the results.
I filed a bug, hopefully it’ll get fixed!

0 Likes

#5

As time goes by, those “Improved” syntax packages may be unmaintained and beat by the built-in ones, which are always adapting latest features and actively maintained…

The latest commit in CImproved is in 2016 by the way.

0 Likes