This code
case 0xfc: printf("CM $%02x%02x",code[2],code[1]); opbytes = 3; break;
case 0xfd: printf("CALL $%02x%02x",code[2],code[1]); opbytes = 3; break;
case 0xfe: printf("CPI #$%02x",code[1]); opbytes = 2; break;
turns into
case 0xfc:
printf("CM $%02x%02x", code[2], code[1]);
opbytes = 3;
break;
case 0xfd:
printf("CALL $%02x%02x", code[2], code[1]);
opbytes = 3;
break;
case 0xfe:
printf("CPI #$%02x", code[1]);
opbytes = 2;
break;
When I format it, it turns a perfectly readable and compact 3 line of switch cases to 12 line of totally unnecessarily formatted code.
case 0xf1: printf("POP PSW"); break;
stays as
case 0xf1: printf("POP PSW"); break;
but when adding one more line it reformats it:
case 0xf1:
printf("POP PSW");
opbytes = 3;
break;
What would be the appropiate config to prevent this?
My current .clang-format
:
AllowShortBlocksOnASingleLine: "true"
AllowShortCaseLabelsOnASingleLine: "true"
AllowShortFunctionsOnASingleLine: All
AllowShortIfStatementsOnASingleLine: WithoutElse
BreakBeforeBraces: Allman
ColumnLimit: 150
We are not exceeding the 150 character column limit. I am at line 230, column 79. even if something wonky happens, we have 71 character leeway until column limit.
1