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?
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With