Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Eclipse tab width not changing

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?

like image 497
Josh Bradley Avatar asked Feb 04 '13 07:02

Josh Bradley


1 Answers

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.

like image 169
Josh Bradley Avatar answered Sep 24 '22 15:09

Josh Bradley