Maintain format of XML comment section on auto-formatting in Eclipse

eclipse, pretty-print, xml

Solution

I'm using Eclipse 3.6.0.

In Windows > Preferences > XML > XML Files > Editor:

Uncheck the Join lines option.

Problem

In Eclipse (Helios) I have this XML source file: ``` <?xml version="1.0" encoding="utf-8"?> <!-- I wanted to =========== save this format of the comments. --> <x> </x> ``` On formatting the file (Ctrl+Shift+F) I got the comment reformatted. ``` <?xml version="1.0" encoding="utf-8"?> <!-- I wanted to =========== save this format of the comments. --> <x> </x> ``` Is there an option to switch off pretty-printing comment sections?

Original source