Skip to content

Commit c2124f2

Browse files
committed
Explicitly setting newline character for Project Settings
This allows projects created on one OS to be used on another and doesn't show ProjectSettings in list of files that changed. Bug: 161486044 Fixes #386 Change-Id: I7a3a196c85348b0d56488501b48a05ec529b30d7
1 parent 825901f commit c2124f2

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

source/VersionHandlerImpl/src/ProjectSettings.cs

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -817,9 +817,14 @@ private static void Save() {
817817
return;
818818
}
819819
try {
820-
using (var writer = new XmlTextWriter(new StreamWriter(PROJECT_SETTINGS_FILE)) {
821-
Formatting = Formatting.Indented,
822-
}) {
820+
using (var writer =
821+
XmlWriter.Create(PROJECT_SETTINGS_FILE,
822+
new XmlWriterSettings {
823+
Indent = true,
824+
IndentChars = " ",
825+
NewLineChars = "\n",
826+
NewLineHandling = NewLineHandling.Replace
827+
})) {
823828
writer.WriteStartElement("projectSettings");
824829
foreach (var key in projectSettings.Keys) {
825830
var value = projectSettings.GetString(key);

0 commit comments

Comments
 (0)