Page 1 of 1

Turning off 'track changes' adds two blank lines to the end of the XML file

Posted: Fri Mar 18, 2016 7:37 pm
by misty
If I disable 'track changes' in a file, the file always has two blank lines at the bottom. This triggers a complaint from Git when I am trying to commit the file, and I have to either manually fix it by going into text mode and removing the lines, or commit with --no-verify. It's a bit of a nuisance. Can I fix it somehow?

Re: Turning off 'track changes' adds two blank lines to the end of the XML file

Posted: Mon Mar 21, 2016 3:25 pm
by Radu
Hi,

I cannot reproduce this behavior.
Indeed by default Oxygen stores change tracking information directly in each edited XML document, this behavior can be configured from the Preferences Editor / Edit modes / Author / Review page.
From what I tested when I enable track changes in a file, if that file contains no new lines after the root, the processing instruction which marks this is placed at the very end of the XML file. Then when I disable change tracking on it, the processing instruction is removed from it.
Can you try experimenting this on your side with an XML file which has no spaces or line breaks after the root element? Or does in your case the XML have extra content after the root?
Also, I'm not sure about why GIT would have a problem with two consecutive new lines. Do you have a hook which checks this? I don't see a problem with having consecutive new lines in an XML document, for example there might also be codeblock sections which would have consecutive new lines in them.

Regards,
Radu