Skip to content
This repository has been archived by the owner on Jun 25, 2024. It is now read-only.

Commit

Permalink
add a space between line numbers for readability
Browse files Browse the repository at this point in the history
  • Loading branch information
ynqa committed Oct 3, 2020
1 parent a86f140 commit 6010478
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions pkg/diffy/unified.go
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ func WriteUnifiedDiff(
for ln, line := range diff.A[i1:i2] {
buf.WriteString(
fmt.Sprintf(
"%s%s%s%s\n",
"%s %s%s%s\n",
color.New(color.Gray).Sprintf("%*d", lnSpaceSize, i1+ln+1),
color.New(color.Gray).Sprintf("%*d", lnSpaceSize, j1+ln+1),
strings.Repeat(" ", opt.SpaceSizeAfterLn),
Expand All @@ -44,7 +44,7 @@ func WriteUnifiedDiff(
for ln, line := range diff.A[i1:i2] {
buf.WriteString(
fmt.Sprintf(
"%s%s%s\n",
" %s%s%s\n",
color.New(color.Gray).Sprintf("%*d", lnSpaceSize, i1+ln+1),
strings.Repeat(" ", lnSpaceSize+opt.SpaceSizeAfterLn),
color.New(color.Red, color.Bold).Sprintf("%s", formatTextLine(line, opt.TabSize)),
Expand All @@ -56,7 +56,7 @@ func WriteUnifiedDiff(
for ln, line := range diff.B[j1:j2] {
buf.WriteString(
fmt.Sprintf(
"%s%s%s\n",
" %s%s%s\n",
color.New(color.Gray).Sprintf("%*d", lnSpaceSize*2, j1+ln+1),
strings.Repeat(" ", opt.SpaceSizeAfterLn),
color.New(color.Green, color.Bold).Sprintf("%s", formatTextLine(line, opt.TabSize)),
Expand Down

0 comments on commit 6010478

Please sign in to comment.