Improve .tscn VCS

Serialize dictionaries adding newlines between key-value pairs
Serialize group lists also with newlines in between
Serialize string properties escaping only " and \ (needed for a good diff experience with built-in scripts and shaders)

Bonus:
Make AnimationPlayer serialize its blend times always sorted so their order is predictable in the .tscn file.

This PR is back-compat; won't break the load of existing files.
This commit is contained in:
Pedro J. Estébanez 2017-01-16 18:03:38 +01:00
parent 681575fa71
commit 7dbb1c0571
6 changed files with 32 additions and 21 deletions

View file

@ -3286,8 +3286,17 @@ String String::c_escape() const {
escaped=escaped.replace("\t","\\t");
escaped=escaped.replace("\v","\\v");
escaped=escaped.replace("\'","\\'");
escaped=escaped.replace("\"","\\\"");
escaped=escaped.replace("\?","\\?");
escaped=escaped.replace("\"","\\\"");
return escaped;
}
String String::c_escape_multiline() const {
String escaped=*this;
escaped=escaped.replace("\\","\\\\");
escaped=escaped.replace("\"","\\\"");
return escaped;
}