simpc-mode icon indicating copy to clipboard operation
simpc-mode copied to clipboard

Fix indentation for case labels

Open alexover1 opened this issue 8 months ago • 0 comments

Case labels are indented in a strange way, so I fixed it.

Previous behavior:

switch (x) {
    case 10:
    printf("x is 10!\n");
    break;
    default:
    printf("x is not 10 :(\n");
    break;
}

Updated behavior:

switch (x) {
case 10:
    printf("x is 10!\n");
    break;
default:
    printf("x is not 10 :(\n");
    break;
}

It is tested to work with multiple labels with fallthrough as well:

switch (x) {
case 1:
case 2:
case 3:
    break;
}

alexover1 avatar Jun 11 '24 16:06 alexover1