Skip to content

Commit b30732b

Browse files
committed
Add +/- prefix to lines
This helps spotting addition/removal of empty lines
1 parent 15d02e0 commit b30732b

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

diff.go

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -41,11 +41,11 @@ func printDiff(before, after string, to io.Writer) {
4141

4242
switch diff.Delta {
4343
case difflib.RightOnly:
44-
fmt.Fprintf(to, "%s\n", ansi.Color(text, "green"))
44+
fmt.Fprintf(to, "%s\n", ansi.Color("+ "+text, "green"))
4545
case difflib.LeftOnly:
46-
fmt.Fprintf(to, "%s\n", ansi.Color(text, "red"))
46+
fmt.Fprintf(to, "%s\n", ansi.Color("- "+text, "red"))
4747
case difflib.Common:
48-
fmt.Fprintf(to, "%s\n", text)
48+
fmt.Fprintf(to, "%s\n", " "+text)
4949
}
5050
}
5151

0 commit comments

Comments
 (0)