How can I stop this happening?


The, this, in question is

 BOOL written = [xml writeToFile:file
                       atomically:NO encoding:NSUTF8StringEncoding

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,


1 comment
Comment actions Permalink

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:


Please sign in to leave a comment.