I find that the Eclipse XML
editor always inserts tabs for spaces even if you have the "Insert spaces for tabs" option checked under Window->Preferences->General->Editors->Text Editors
.
You can open any XML
file, and then do CTRL-SHIFT-F
to format the file and you'll see this behavior (all your spaces will be replaced with tabs where appropriate).
I noticed this behavior with Ganymede, and just upgraded to Galileo today and was hoping it was fixed, but it seems to be the same.
Is this a bug, or am I doing something incorrectly?
Eclipse - Tab to spaces And eclipse uses tabs for spaces by default. Tabs are always dependent on the environment and use 4 spaces in windows. If you use source code written with tab spaces, code is consistent across different environments.
Go to Windows > Preferences > XML > XML Files > Editor and select Indent using spaces:
Not sure about this issue with the XML editor specifically, but I use the AnyEdit tools plugin to handle any tabs/spaces issues.
Once you've installed the plugin go to Preferences -> General -> Editors -> AnyEdit Tools and you can enable auto conversion of tabs to spaces (or vice versa) whenever you save a file. I find this very useful because it will also fix any files you've accidentally inserted tabs into when you change those files.
This plugin also provides a nice set text functions to use in the 'Convert' section of the right click menu of any text editor.
Eclipse -> Preferences
XML -> XML Files -> Editor
Indent using spaces
optionIf 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