• Open Menu Close Menu
  • Apple
  • Shopping Bag
  • Apple
  • Mac
  • iPad
  • iPhone
  • Watch
  • TV
  • Music
  • Support
  • Search apple.com
  • Shopping Bag

Lists

Open Menu Close Menu
  • Terms and Conditions
  • Lists hosted on this site
  • Email the Postmaster
  • Tips for posting to public mailing lists
Re: Xcode 3 auto-intent driving me crazy!
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Xcode 3 auto-intent driving me crazy!


  • Subject: Re: Xcode 3 auto-intent driving me crazy!
  • From: David Ewing <email@hidden>
  • Date: Sat, 3 May 2008 22:54:23 -0600


On May 1, 2008, at 3:03 PM, Steve Checkoway wrote:

Roy Lovejoy wrote:
On May 1, 2008, at 11:58 AM, Jason Watts wrote:
Hi folks,

Does anyone know of a way to set the Xcode 3 editor to match the indent of the previous line and nothing else?
no, but I second the insanity-

File a bug report. I did a while back <rdar://problem/5865054> which was marked as a duplicate of <rdar://problem/3721902>. The more people who file reports on this, the more likely they are to address it. Be specific and tell them exactly what it is you want. (I wanted more options similar to how emacs or vim control every aspect of indentation.)

Looking at your bug, I don't see anything that Xcode 3.0 doesn't already support. It looks like the main thing you want is to not indent the case labels inside a switch (and the code for each case). You can get this by setting a user default in Terminal:

defaults write com.apple.Xcode XCCodeSenseFormattingOptions '{ CaseStatementSpacing = ""; }'

For those listening in, here is an example of the formatting Steve would like to see:

-----
void foo( int arg )
{
switch( arg )
{
case 0:
bar();
break;
case 1:
baz();
break;
}
}
-----

Generally Xcode won't do more fancy formatting (it just indents) - except with code completion and when inserting text macros. For the switch statement text macro to match what you like, you'd need the more complex default:

defaults write com.apple.Xcode XCCodeSenseFormattingOptions '{ CaseStatementSpacing = ""; PreExpressionsSpacing = ""; InExpressionsSpacing = " "; BlockSeparator = "\n"; }'

I've included the documentation for this user default at the end of this email. It hasn't yet made into the formal doc set. I hope it does soon, but as always, no promises.


i especially hate when you're at the end of the line, hit return, nothing happens, hit return again, you get double spaced.

I haven't seen that happen, but the speed of the editor coupled with the indentation has made me put Xcode aside for all but one largish project.

We're working constantly on editor performance. Any issues you see should be filed since the performance often depends (sometimes in surprising ways) on the particular source file being edited.

is it too much to ask, when a release occurs, keep the same functionality (retaining prefs, etc), and simply offer the alternate workflow as an option, instead of forcing the different workflow, and making people RESEARCH how to get back to their comfort zone.
I'm looking at YOU "undo past save" alert..

This particular alert has been discussed many times on this email list, and is documented in the Xcode Expert Preferences Notes. Or Google "Xcode undo past save".

All you can do is file bug reports. The bug reporting system seems to have improved a lot. I've been receiving notifications when bug statuses change and from time to time, individual replies which are greatly appreciated. It's no longer the black hole it used to be.

That's nice to hear. :-)

Dave

-----

XCCodeSenseFormattingOptions

Description

A dictionary of containing values that get expanded with text macros and code completion.

(Key name = default value)
PreExpressionsSpacing = " "
The spacing between an if, for, while keyword and the opening parenthesis.

InExpressionsSpacing = ""
The spacing inside a parentesized _expression_ (after the opening '(' and before the closing ')').
                  
PreFunctionArgsSpacing = ""
The spacing between function name and the opening parenthesis.

InFunctionArgsSpacing = ""
The spacing inside a parentesized function argument list (after the opening '(' and before the closing ')').

PreCommaSpacing = ""
The spacing before a comma inside function argument list.

PostCommaSpacing = " "
The spacing after a comma inside function argument list.

PreMethodTypeSpacing = " "
The spacing before the parenthesized return type in an Objective-C method declarator.

PreMethodDeclSpacing = " "
The spacing between the parenthesized return type and the method name of an Objective-C method declarator.
                  
InMessageSpacing = ""
The spacing inside a Objective-C message call _expression_ (after the opening '[' and before the closing ']').

PreColonSpacing = ""
The spacing before a colon in an Objective-C method name or message call _expression_.

PostColonSpacing = ""
The spacing after a colon in an Objective-C method name or message call _expression_.

MessageArgSpacing = ""
The spacing between the parenthesized type and parameter name in an Objective-C method declarator.
                  
CaseStatementSpacing = "\t"
The relative indentation of a case keyword inside a switch block. (A tab character means indent by the given indentation width.)

BlockSeparator = " "
The spacing after the parenthesized _expression_ of an if, for, or while statement and the opening '{'.

PostBlockSeparator = "\n"
The spacing after the closing '}' of a block.

FunctionBlockSeparator = "\n"
The spacing after a method or function declarator and the opening '{'.

 _______________________________________________
Do not post admin requests to the list. They will be ignored.
Xcode-users mailing list      (email@hidden)
Help/Unsubscribe/Update your Subscription:

This email sent to email@hidden

  • Follow-Ups:
    • Re: Xcode 3 auto-intent driving me crazy!
      • From: "William H. Schultz" <email@hidden>
    • Re: Xcode 3 auto-intent driving me crazy!
      • From: Steve Checkoway <email@hidden>
References: 
 >Xcode 3 auto-intent driving me crazy! (From: Jason Watts <email@hidden>)
 >Re: Xcode 3 auto-intent driving me crazy! (From: Roy Lovejoy <email@hidden>)
 >Re: Xcode 3 auto-intent driving me crazy! (From: Steve Checkoway <email@hidden>)

  • Prev by Date: Re: Error running unit test of framework
  • Next by Date: Re: Is PHP-Support for Xcode 3.0 planned?
  • Previous by thread: Re: Xcode 3 auto-intent driving me crazy!
  • Next by thread: Re: Xcode 3 auto-intent driving me crazy!
  • Index(es):
    • Date
    • Thread