Fix rendering of file added/removed lines

This commit is contained in:
Kovid Goyal 2023-04-03 11:07:51 +05:30
parent bca67cde6f
commit e07f2df8d0
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -650,15 +650,19 @@ func all_lines(path string, columns, margin_size int, is_add bool, ans []*Logica
sl := ScreenLine{} sl := ScreenLine{}
if is_add { if is_add {
sl.right = hl sl.right = hl
if i < len(msg_lines) { if len(msg_lines) > 0 {
sl.left.marked_up_text = msg_lines[i] sl.left.marked_up_text = msg_lines[i]
sl.left.is_filler = true
msg_lines = msg_lines[1:]
} else { } else {
sl.left.is_filler = true sl.left.is_filler = true
} }
} else { } else {
sl.left = hl sl.left = hl
if i < len(msg_lines) { if len(msg_lines) > 0 {
sl.right.marked_up_text = msg_lines[i] sl.right.marked_up_text = msg_lines[i]
sl.right.is_filler = true
msg_lines = msg_lines[1:]
} else { } else {
sl.right.is_filler = true sl.right.is_filler = true
} }