Skip to content

Commit 01027f7

Browse files
committed
Output LF instead of CRLF, so that git doesn't display ^M at the end of modified lines
1 parent 63468bb commit 01027f7

File tree

2 files changed

+8
-7
lines changed

2 files changed

+8
-7
lines changed

src/git-diff-xlsx/ElementHandlers/CellEndElementHandler.cs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,5 @@
1-
using System.Collections.Generic;
1+
using System;
2+
using System.Collections.Generic;
23
using System.IO;
34

45
namespace git_diff_xlsx.ElementHandlers
@@ -18,7 +19,7 @@ public override void Invoke(CellContext cellContext, TextWriter output)
1819
{
1920
if (cellContext != null)
2021
{
21-
output.WriteLine(" " + Format(cellContext));
22+
output.Write($" {Format(cellContext)}\n");
2223
}
2324
}
2425

src/git-diff-xlsx/ExcelFilePrinter.cs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -67,19 +67,19 @@ private Dictionary<int, string> CompileNumberingFormatsByStyleIndex(Stylesheet s
6767

6868
private void PrintSheetNames(Dictionary<string, string> sheetNames, TextWriter output)
6969
{
70-
output.WriteLine(string.Join(",", sheetNames.Select(x => x.Value)));
70+
output.Write($"{string.Join(",", sheetNames.Select(x => x.Value))}\n");
7171
}
7272

7373
private void PrintLastEditedBy(PackageProperties documentProperties, TextWriter output)
7474
{
75-
output.WriteLine("File last edited by " + documentProperties.LastModifiedBy);
75+
output.Write($"File last edited by {documentProperties.LastModifiedBy}\n");
7676
}
7777

7878
private void PrintSheetContent(WorksheetPart worksheetPart, string worksheetName, string[] sharedStringTable, Dictionary<int, string> numberingFormatsByStyleIndex, TextWriter output)
7979
{
80-
output.WriteLine("=================================");
81-
output.WriteLine($"Sheet: {worksheetName} [ {worksheetPart.Worksheet.SheetDimension.Reference.Value} ]");
82-
output.WriteLine("=================================");
80+
output.Write("=================================\n");
81+
output.Write($"Sheet: {worksheetName} [ {worksheetPart.Worksheet.SheetDimension.Reference.Value} ]\n");
82+
output.Write("=================================\n");
8383

8484
var startElementHandlers = new Dictionary<Type, StartElementHandler>
8585
{

0 commit comments

Comments
 (0)