Code::Blocks Forums

User forums => Help => Topic started by: vix on July 17, 2009, 01:20:53 pm

Title: Matching brace and preprocessor
Post by: vix on July 17, 2009, 01:20:53 pm
I don't know if this is a known behaviour; I searched into the forum but I didn't find any information about it, so I started a new thread.
The Matching Brace feature doesn't work in the right way when there are some preprocessor directives.
For example if you have the following code
Code
{
a++;
#if 0
if(a==1){
#else
if(b==2){
#endif
c = a+b;
}
c--;
}
the first '{' is highlighted as 'no matching brace', the one after "if(a==1)" is matched with the last one, and so on...

I know this could seem quite a strange piece of code, and in fact it is...
I know there is an easy workaround (i.e. moving all the '{' outside preprocessor directives),
but I only want to point out this unexpected behaviour.

Best regards

vix
Title: Re: Matching brace and preprocessor
Post by: ollydbg on July 17, 2009, 05:47:17 pm
I think this is a problem in
http://www.scintilla.org/