We've discussed this on the Oxygen users list, but I'm also mentioning it here in case anyone else wants something similar.
There is no option in Oxygen to tell the formatter to treat an XML comment differently.
Oxygen formats an element differently depending on its type of content (elements and/or text).
Given your description (that the line breaks before the comment), I can only assume that your "pattern" element contains only elements
Code: Select all
<pattern><!-- This is a comment -->
In this case, if you want to force the formatter to keep the XML comment where it is without breaking the line, you can tell it that "pattern"
has "Mixed content" (elements and text). In Editor / Format / XML
, go to the Elements spacing
> "Mixed content" tab and Add the "pattern" element to the list.
Also note that if there is a space between the start tag and the comment, the Oxygen formatter will consider it's fair to replace the space with a line break.