最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

swift - Xcode 16.2 text indentation - Stack Overflow

programmeradmin6浏览0评论

For some reason my indentation isn't working as expected. I have set it to indent using 4 spaces but for some reason it indents with 2 spaces everywhere in the project. I've tried going on Xcode > System Settings > Text Editing > Indentation Tab. I've also quit Xcode and deleted derived data to no success. I have swiftlint, but nothing in it is about indentation.

I'm stuck. Would love some help.

Screenshot of my text settings in file:

Screenshot of Text Editing > Indentation Tab:

For some reason my indentation isn't working as expected. I have set it to indent using 4 spaces but for some reason it indents with 2 spaces everywhere in the project. I've tried going on Xcode > System Settings > Text Editing > Indentation Tab. I've also quit Xcode and deleted derived data to no success. I have swiftlint, but nothing in it is about indentation.

I'm stuck. Would love some help.

Screenshot of my text settings in file:

Screenshot of Text Editing > Indentation Tab:

Share Improve this question edited yesterday JasLamba asked yesterday JasLambaJasLamba 291 silver badge7 bronze badges 8
  • Strange, I also have Xcode 16.2 but my settings view for the indentation tab looks nothing like your screenshot. I assume "System Settings" is a typo. – Joakim Danielson Commented yesterday
  • Yup thats a typo it should be Xcode > Settings > Text Editing > Indentation Tab instead. It is indeed strange and its been driving me up the wall haha – JasLamba Commented yesterday
  • Could you show a screenshot of the TextEditing > Indentation screen? – matt Commented yesterday
  • By the way, although I prefer 4 spaces because I'm used to it, there is a case to be made that 2 spaces is "right". – matt Commented yesterday
  • 1 Do you have .editorConfig file in your project? – HangarRash Commented yesterday
 |  Show 3 more comments

1 Answer 1

Reset to default -1

Locate the .editorConfig file and ensure your indent value is correctly set there. Make sure that you check root of your project directory.

发布评论

评论列表(0)

  1. 暂无评论