Astral formatting multiple lines <<

I use astyle, which is great for applying a standard style to existing code. However, I noticed that when this happens:

 ostringstream myStream; myStream << 1 << 2; 

he reformatts to this:

 ostringstream myStream; myStream << 1 << 2; 

Here is my parameter file: (version 1.23)

 --indent=spaces --brackets=break --indent-switches --indent-namespaces --min-conditional-indent=4 --break-closing-brackets --pad-paren-in --unpad-paren --convert-tabs 

Is there a way for him to draw a line "<<on the next line?

Edit:

I also tried version 1.22 with the following file (test.cpp):

 void main() { ostringstream myStream; myStream << 1 << 2; } 

with the following parameters (format.txt):

 --indent=spaces --brackets=break-closing --indent-switches --indent-namespaces --min-conditional-indent=4 --pad=paren-in --unpad=paren --convert-tabs 

and the following command line:

astyle --options = format.txt test.cpp

who produced this:

 void main() { ostringstream myStream; myStream << 1 << 2; } 
+6
source share
2 answers

The final conclusion is the mistake of seeing the bottom

I tried to replicate your problem and could not get the behavior you are talking about (updating the OP question denies this)

Edit: (removed content to update)

Parameter names have changed between 1.22 and 1.23.

If none of them solves the problem, try downloading more code as an example, or try repeating your problem using only the code you inserted here. (Done by OP)

I also found that the order of the options seems to make a difference sometimes. For example:

 astyle --indent=tab --style=ansi test.cpp 

- this is not the same as:

 astyle --style=ansi --indent=tab test.cpp 

Setting the second "-style = ansi" actually negates the "-indent = tab".

I would not be surprised if this could be your problem.

... But after playing with this for 20 minutes, I am convinced that this is astil error .

Edit to include error link: error Thanks Markh44

+8
source

@ Katskul, you're right, this is a mistake.

I finally found this:

http://sourceforge.net/tracker/index.php?func=detail&aid=1713990&group_id=2319&atid=102319

+2
source

All Articles