Search code examples
xcodexcode4

Xcode stopped auto-indenting


When I press Enter in Xcode 4, the cursor ends up at the beginning of the next line instead of indenting it as the previous line. I don't remember doing anything that could cause this, such as modifying any editor preference or anything like that.

Why is this happening, and how can I fix this?


Solution

  • Try moving your Xcode prefs aside and seeing what happens. They're in

    • ~/Library/Preferences/com.apple.dt.Xcode.plist
    • ~/Library/Preferences/com.apple.dt.Xcode.LSSharedFileList.plist

    You can simply quit Xcode, move those files to your desktop, or somewhere like that, and re-launch Xcode and see if it still happens. If it doesn't happen anymore, then it may mean your prefs got corrupt somehow. If it still happens, then it's not related to your prefs, and you can move them back.