Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

XCode: Function argument indentation

I was unable to find any solution of my specific issue. I'm using Xcode 3.2. I'd like to indent the next line of function argument just one step in from the previous line:

somevariable = pow(
    a,
    b);

However, Xcode's syntax-aware indenting insists on converting the above into:

somevariable = pow(
                   a,
                   b);

Where the arguments are aligned with opening parenthesis of the function.

How can I make indenting be configured to match my preference?

like image 992
Victor Yudin Avatar asked May 17 '10 18:05

Victor Yudin


1 Answers

XCode (at least the version I have, 3.1.3) has a preferences pane called "indentation" that lets you click on/off a checkmark next to several characters such as semicolon, return,etc.

If you turn OFF the checkmark for return and semicolon, you can control the most important parts of your own indenting.

For instance, I declare my variables at the head of the function, and I like them flush; whereas XCode as first installed insisted on bringing them to the same level as the code.

I turned off the semicolon, and presto, it'll leave them there. Most of the time. It still screws them up during copy/pasta actions, but mostly it behaves. :)

like image 175
fyngyrz Avatar answered Nov 11 '22 17:11

fyngyrz