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

Oxygen general issues.
misty
Posts: 16
Joined: Tue Feb 03, 2015 3:23 am

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

Post 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?
Radu
Posts: 9053
Joined: Fri Jul 09, 2004 5:18 pm

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

Post 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
Radu Coravu
<oXygen/> XML Editor
http://www.oxygenxml.com
Post Reply