• 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: auto syntax indenting
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: auto syntax indenting


  • Subject: Re: auto syntax indenting
  • From: Mike Lazear <email@hidden>
  • Date: Thu, 7 Apr 2005 13:59:33 -0700


On Apr 7, 2005, at 1:47 PM, Markian Hlynka wrote:


On Apr 7, 2005, at 13:36, Mike Lazear wrote:


On Apr 7, 2005, at 11:50 AM, Markian Hlynka wrote:

Here's something annoying. Is it just me, or does everyone see this?

I had:

	for( i = 0; i < N; i++ )
		for( j = 0; j < N; j++ )
			if (aboard.board[i][j].colour != empty)
			{
				thekey ^= myZobrist[i][j][aboard.board[i][j]];
			}
            blah;


now, here are my issues. First off, blah is auto-indented to the wrong spot. Second, for some reason it's indented with spaces, while the other lines are tab-indented. I thought I'd had tabs turned OFF. Why is this happening? Could this be related to the "Tab indents: In leading white space" setting under prefs->indentation?


So, "blah" should actually be aligned with "thekey ^="

Why would "blah" align with thekey"? it's outside of the if therefore it should be aligned with the very first for.



exactly my point. I'mm saying that mail aligned it incorrectly above because of a space/tab issue. but in xcode, it alligns with thekey, which as you point out, it patently should NOT.

Okay, I get what you are saying now. When you used the words "should actually" I thought you were saying that was where you expected "blah" to be, rather than that was where Xcode was putting it.


As for the indenting, as mentioned below, Xcode gets very confused when braces are not used. Other than adding the braces to the for loops I don't know of any way to fix that. Hopefully this will be cleaned up in the Xcode version coming.



Xcode indenting has a way of getting very confused. Start using if { } and else without braces and it gets really messed up quick!


agreed.


1. Why do I have tabs when "Editor uses tabs" is NOT checked in Text Editing prefs.
2. should I file a bug for the aberrant auto-indent behaviour?

Have you gone thru and removed all existing tabs from your files?

My file originated before I started using xcode, and should _never have _any tabs. So, I'm making the assumption that if there's tabs, it's because xcode put them there when I wasn't looking. That's why I'm trying to understand this "Tab indents: In leading white space" preference.


Changing the preference to use spaces instead of tabs does not, in my experience, automatically replace existing tabs.
I had a similar thing and used BBEdit to replace all tabs with spaces.

BBEdit sans tabs is what the file was originally created with. So, yes, I can and have and will do that, but I want to figure out where the tabs are coming from first.

If you started with no tabs and you have the preferences set for no tabs then I'm not sure what would have caused the tabs. I will note that I often copy sample code from Apple's samples and other places and they usually have tabs in them. So I have to remove tabs occasionally to weed out any tabs that have gotten into my code.


Mike


_______________________________________________ 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
References: 
 >auto syntax indenting (From: Markian Hlynka <email@hidden>)
 >Re: auto syntax indenting (From: Mike Lazear <email@hidden>)
 >Re: auto syntax indenting (From: Markian Hlynka <email@hidden>)

  • Prev by Date: Re: auto syntax indenting
  • Next by Date: Re: Questions
  • Previous by thread: Re: auto syntax indenting
  • Next by thread: How to change the default path type
  • Index(es):
    • Date
    • Thread