More work on the diff kitten

This commit is contained in:
Kovid Goyal 2018-04-29 08:07:03 +05:30
parent 8fa492e0ee
commit 4760580d1c
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 8 additions and 7 deletions

View File

@ -1,11 +1,11 @@
foreground black
background #eeeeee
background white
title_fg black
title_bg #eeeeee
margin_bg #dddddd
margin_fg #444444
title_bg white
margin_bg #fafbfc
margin_fg #aaaaaa
removed_bg #ffeef0
removed_margin_bg #ffdce0
added_bg #e6ffed
added_margin_bg #cdffd8
filler_bg #cccccc
filler_bg #fafbfc

View File

@ -112,7 +112,6 @@ def title_lines(left_path, right_path, args, columns, margin_size):
name = fit_in(sanitize(path_name_map[left_path]), columns - 2 * margin_size)
yield title_format(place_in(' ' + name, columns))
yield title_format('' * columns)
yield title_format(' ' * columns)
def binary_lines(path, other_path, columns, margin_size):
@ -170,9 +169,11 @@ def lines_for_diff(left_path, right_path, hunks, args, columns, margin_size):
right_wrapped_lines = list(split_to_size(right_lines[right_line_number], available_cols))
even_up_sides(left_wrapped_lines, right_wrapped_lines, '')
for i, (left, right) in enumerate(zip(left_wrapped_lines, right_wrapped_lines)):
ln = None if left_line_number is None else hunk.left_start + left_line_number
rn = None if right_line_number is None else hunk.right_start + right_line_number
yield Line(
render_diff_pair(
left_line_number, left, left_is_change, right_line_number, right,
ln, left, left_is_change, rn, right,
right_is_change, i == 0, margin_size, available_cols
),
Reference(left_path, HunkRef(hunk_num, line_num))