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

2

6

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?

Bebeeru answered 12/7, 2012 at 13:12 Comment(0)
O
12

I'm using Eclipse 3.6.0.

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

Uncheck the Join lines option.

Onepiece answered 25/10, 2012 at 10:5 Comment(1)
You can also uncheck the whole "format comments" option, which looks quite useful, because the formatting of the comments happens always as clear text.Chetnik
F
1

You can select only part of your XML file for formatting and leave out the comment part.

Form answered 25/10, 2012 at 10:7 Comment(2)
but how can we format the comments just like normal lines??? that's the real questionAmpliate
PeterMmm originally asked "Is there an option to switch of pretty-print of comment sections ?". My answer is a workaround for this. @paul.cioroianu: If your questions is not covered you might want to create a new one.Form

© 2022 - 2024 — McMap. All rights reserved.