@@ -365,7 +365,8 @@ func (dv *DiffView) renderUnified() string {
365 shouldWrite := func() bool { return printedLines >= 0 }
365 shouldWrite := func() bool { return printedLines >= 0 }
367 getContent := func(in string, ls LineStyle) (content string, leadingEllipsis bool) {
367 getContent := func(in string, ls LineStyle) (content string, leadingEllipsis bool) {
368− content = strings.TrimSuffix(in, "\n")
368+ content = strings.ReplaceAll(in, "\r\n", "\n")
369+ content = strings.TrimSuffix(content, "\n")
369 content = dv.hightlightCode(content, ls.Code.GetBackground())
370 content = dv.hightlightCode(content, ls.Code.GetBackground())
370 content = ansi.GraphemeWidth.Cut(content, dv.xOffset, len(content))
371 content = ansi.GraphemeWidth.Cut(content, dv.xOffset, len(content))
371 content = ansi.Truncate(content, dv.codeWidth, "…")
372 content = ansi.Truncate(content, dv.codeWidth, "…")
@@ -488,7 +489,8 @@ func (dv *DiffView) renderSplit() string {
488 shouldWrite := func() bool { return printedLines >= 0 }
489 shouldWrite := func() bool { return printedLines >= 0 }
490 getContent := func(in string, ls LineStyle) (content string, leadingEllipsis bool) {
491 getContent := func(in string, ls LineStyle) (content string, leadingEllipsis bool) {
491− content = strings.TrimSuffix(in, "\n")
492+ content = strings.ReplaceAll(in, "\r\n", "\n")
493+ content = strings.TrimSuffix(content, "\n")
492 content = dv.hightlightCode(content, ls.Code.GetBackground())
494 content = dv.hightlightCode(content, ls.Code.GetBackground())
493 content = ansi.GraphemeWidth.Cut(content, dv.xOffset, len(content))
495 content = ansi.GraphemeWidth.Cut(content, dv.xOffset, len(content))
494 content = ansi.Truncate(content, dv.codeWidth, "…")
496 content = ansi.Truncate(content, dv.codeWidth, "…")