How can I stop this happening?
Hi.
The, this, in question is
BOOL written = [xml writeToFile:file atomically:NO encoding:NSUTF8StringEncoding error:&error];
where AppCode is formatting the atomically: and encoding: parts of the selector on the same line.
I suppose it's a bit anal of me but I either like a selector to fit on one line OR I want each part of the selector on it's own line and lined up. I really can't abide this half-way house.
My choices seem to be either wrap-always which I don't like because then even short selectors get broken, unnecessarily, onto multiple lines, or this behaviour.
It's really bothering me so is there some way to have it the way I want it?
Kind regards,
Matt
请先登录再写评论。
Matt,
there are several options in Preferences->Code Style->Wrapping and Braces for 'Method parameters' and 'Method call arguments': Do not wrap, Wrap if long, Chop down if long and Wrap always.
'Wrap if long' means AppCode would place an argument that doesn't fit the margins on the next line, so you'll end up with the code in your example.
If you set 'Chop down if long', AppCode puts every argument or parameter on a new line if any of them doesn't fit margin.
You can experiment with the settings in the Preferences dialog and see how they affect the code in the live preview.
Currently, though, if you have code wrapped, AppCode will not reformat if it fits the margins already. Here is the corresponding request: http://youtrack.jetbrains.com/issue/OC-4290.