Re: Xcode editor - code jumps 13 tab spaces
Re: Xcode editor - code jumps 13 tab spaces
- Subject: Re: Xcode editor - code jumps 13 tab spaces
- From: Ken Thomases <email@hidden>
- Date: Sat, 27 Feb 2010 06:38:29 -0600
On Feb 27, 2010, at 6:21 AM, Ian Piper wrote:
> I'm encountering a really annoying problem in the Xcode editor. When entering code, if I hit Return to start a new method, or if I type a ":" symbol in a line of code, the cursor (or the whole line of code if I have started typing something) jumps 13 tabs across the screen. This happens on two of my Macs, both running Xcode 3.2.1. It may sound like a trivial problem but it means that long lines of text just disappear off the side of the screen, resulting in a lot of scrolling. If I select the text and move it back, it jumps in again the next time I type a ":".
>
> Can anyone advise me on how to stop this irritating pheonomenon?
You can turn off Syntax-aware indenting in Xcode's preferences, under Indentation.
However, I suspect the reason is that Xcode believes there is an unbalanced opening brace or bracket at a deep level of indentation. In other words, it believes it's indenting to the proper level for the syntax of the code as written.
For example, does it do this at the top of the file? I suspect it only starts partway down the file. You can use the code level indicator ("code folding ribbon") in the window gutter so find where it loses track (or where your code really is unbalanced).
Do you use constructs like the following contrived example?
#if 1
- (void) someMethod
{
#else
- (BOOL) alternativeMethodWithArg:(id)arg
{
#endif
/* ... */
}
such that the opening brace of the method body is doubled in a naive parsing of the text? That's likely to confuse Xcode.
Regards,
Ken
_______________________________________________
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