How can I remove extra spaces from my code using astyle
? For example I want to convert the following code:
void foo ( int a , int c )
{
d = a+ c;
}
to this:
void foo (int a, int c)
{
d = a + c;
}
But astyle is currently converting it to this:
void foo (int a , int c)
{
d = a + c;
}
There is currently no way to unpad the spaces around operators in astyle. If there had been a way to unpad the operators, you could have first unpadded the spaces, and then again pad them using -p option.
--pad-oper / -p
Insert space padding around operators.
Any end of line comments will remain in the original column, if possible.
Note that there is no option to unpad. Once padded, they stay padded.
if (foo==2)
a=bar((b-c)*a,d--);
becomes:
if (foo == 2)
a = bar((b - c) * a, d--);
Source : http://astyle.sourceforge.net/astyle.html#_pad-oper
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With