Eclipse tab width not changing

馋奶兔 提交于 2019-12-07 06:10:30

问题


I've looked through a couple of posts related to this but they don't seem to help me solve my problem. I have a project where the java files are indented with a 2-space width. I would like to change everything to 4-space width. I tried the "correct indentation" option but it just moves everything back to a 2-space width when I modify a few lines to 4-space indentation. I've checked settings in Java->Code Style->Formatter and the default is 4-space width. I've also checked settings at General->Editors->Text Editors and they are set to 4-space tab width.

I thought the correct indentation may have been reading the whole java file and correcting the code so it conforms to everything else in the file, so I manually modified every line to have 4-space width indentation. Autocorrect indentation still takes everything back to 2 spaces. Has anyone had this problem before? Is there another setting to change?


回答1:


I found the solution. The project-specific settings had the indentation width set to 2, not 4. These settings must have overridden the eclipse settings.



来源:https://stackoverflow.com/questions/14681954/eclipse-tab-width-not-changing

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!