Skip to content

Commit dd26e6b

Browse files
committed
add some newlines between files for spacing and readability
1 parent 652032a commit dd26e6b

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

diff-so-fancy

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,7 +38,7 @@ git_index_line_pattern="^($color_code_regex)index .*"
3838

3939
format_diff_header () {
4040
# simplify the unified patch diff header
41-
$SED -E "/^($color_code_regex)diff --git .*$/d" \
41+
$SED -E "s/^($color_code_regex)diff --git .*$//g" \
4242
| $SED -E "/$git_index_line_pattern/{N;s/$git_index_line_pattern\n//;}" \
4343
| $SED -E "s/^($color_code_regex)\-\-\-(.*)$/\1$(print_horizontal_rule)\\${NL}\1\-\-\-\-\5/g" \
4444
| $SED -E "s/^($color_code_regex)\+\+\+(.*)$/\1\+\+\+\+\5\\${NL}\1$(print_horizontal_rule)/g"
@@ -53,6 +53,10 @@ mark_empty_lines () {
5353
$SED -E "s/^$color_code_regex[\+\-]$reset_color\s*$/$invert_color\1 $reset_escape/g"
5454
}
5555

56+
remove_first_empty_line () {
57+
$SED -E '1 D'
58+
}
59+
5660
strip_leading_symbols () {
5761
# strip the + and -
5862
$SED -E "s/^($color_code_regex)[\+\-]/\1 /g"
@@ -73,5 +77,6 @@ cat $input \
7377
| format_diff_header \
7478
| colorize_context_line \
7579
| mark_empty_lines \
80+
| remove_first_empty_line \
7681
| strip_leading_symbols \
7782
| strip_first_column

0 commit comments

Comments
 (0)