Code::Blocks Forums

User forums => Using Code::Blocks => Topic started by: mastermatic on November 20, 2007, 05:09:33 pm

Title: indentation
Post by: mastermatic on November 20, 2007, 05:09:33 pm
When formating the source code , using the 'source code formatter (AStyle) ' plugin, the indentation after a colon ( in a case(): ) puts for example 4 tabs instead of 4 spaces.
The thing comes like this:

    case SIGNAL(ID_NUMTEC_5, PSF_CLICKED):
                    if (digit<MAXCALDIGIT)                    <<<<<<<<<<<< here!!
            {

Can it be corrected?

Best Regards
José Barbosa
Title: Re: indentation
Post by: mastermatic on November 27, 2007, 06:46:12 pm
Am I the only one with this problem?

José Barbosa
Title: Re: indentation
Post by: mastermatic on November 27, 2007, 07:15:01 pm
just to clarify, here comes 5 examples:

*Note the indentation when the  -  if   -  comes just after the colon.

//----------------------------------
case (something):
            if (anything) DoNothing();
break;
//----------------------------------
case (something):
            if (anything)
    {
        DoNothing();
    }
break;
//-----------------------------------
case (something):
{
    if (anything) DoNothing();
}
break;
//-----------------------------------
case something:
DoNothing();                        // <<<<<---- and this?
break;
//-----------------------------------
case something:
{
    DoNothing();
}
break;
//-----------------------------------

Best Regards
José Barbosa


Title: Re: indentation
Post by: Ceniza on November 28, 2007, 05:13:50 am
The AStyle plugin relies on AStyle. Any bug you find in it should be reported to the AStyle developers. The project's website is http://astyle.sf.net/