tags:

views:

45

answers:

2

Hi,

I'm using Galileo, and I've gone:

Preferences -> General -> Editors -> Text Editors -> Spaces for tabs

but the editor still inserts real tabs when I press the tab key. This is driving me crazy. How do I force eclipse to put in spaces for tabs? I'm editing java files.

Thanks

+1  A: 

What about :

  • Window > Preferences > Java > Code Style > Formater
  • and, then, edit the formating style (it'll open another dialog)
  • In that new dialog :
    • General settings > Tab policy => choose "Spaces only", instead of "Tabs only"
    • You can also set the "Tab size".
Pascal MARTIN
Thank you, been driving me crazy.
You're welcome :-) *(I don't use Eclipse for JAVA development, but I've had exactly the same problem for PHP development a couple of times ^^ )*
Pascal MARTIN
So this raises another question: why is there a "Preferences -> General -> Editors -> Text Editors -> Spaces for tabs" that is apparently ignored by (at least) the Java and PHP editors which have their own (apparently identical) setting?
Laurence Gonsalves
A: 

Go to Preferences -> Java -> Code Style -> Formatter. Click edit next to your active profile. Change your tab policy to Spaces Only

bkritzer
Thank you as well.