If insert a disable block in switch-case, the case with curly brackets will be added a addition indentation on case's statement and }
For example:
Expected formatted output:
void func(int para)
{
switch (para) {
case 0: {
init(ch);
break;
}
case 1: {
/* *INDENT-OFF* */
for (int ch = 0; ch < TOTAL_CH; ch++) {
init(ch);
}
/* *INDENT-ON* */
break;
}
case 2: {
init(ch);
break;
}
default:
init(ch);
break;
}
}
Actual formatted output:
void func(int para)
{
switch (para) {
case 0: {
init(ch);
break;
}
case 1: {
/* *INDENT-OFF* */
for (int ch = 0; ch < TOTAL_CH; ch++) {
init(ch);
}
/* *INDENT-ON* */
break;
}
case 2: {
init(ch);
break;
}
default:
init(ch);
break;
}
}
Besides, if place the disable block inside the for-statement, it also incorrect and output the different identation.
Orginal
Formatted 3 times