Show More
@@ -2731,8 +2731,8 b' def diffsinglehunk(hunklines):' | |||||
2731 | def diffsinglehunkinline(hunklines): |
|
2731 | def diffsinglehunkinline(hunklines): | |
2732 | """yield tokens for a list of lines in a single hunk, with inline colors""" |
|
2732 | """yield tokens for a list of lines in a single hunk, with inline colors""" | |
2733 | # prepare deleted, and inserted content |
|
2733 | # prepare deleted, and inserted content | |
2734 |
a = b |
|
2734 | a = bytearray() | |
2735 |
b = b |
|
2735 | b = bytearray() | |
2736 | for line in hunklines: |
|
2736 | for line in hunklines: | |
2737 | if line[0:1] == b'-': |
|
2737 | if line[0:1] == b'-': | |
2738 | a += line[1:] |
|
2738 | a += line[1:] | |
@@ -2746,8 +2746,8 b' def diffsinglehunkinline(hunklines):' | |||||
2746 | yield t |
|
2746 | yield t | |
2747 | return |
|
2747 | return | |
2748 | # re-split the content into words |
|
2748 | # re-split the content into words | |
2749 | al = wordsplitter.findall(a) |
|
2749 | al = wordsplitter.findall(bytes(a)) | |
2750 | bl = wordsplitter.findall(b) |
|
2750 | bl = wordsplitter.findall(bytes(b)) | |
2751 | # re-arrange the words to lines since the diff algorithm is line-based |
|
2751 | # re-arrange the words to lines since the diff algorithm is line-based | |
2752 | aln = [s if s == b'\n' else s + b'\n' for s in al] |
|
2752 | aln = [s if s == b'\n' else s + b'\n' for s in al] | |
2753 | bln = [s if s == b'\n' else s + b'\n' for s in bl] |
|
2753 | bln = [s if s == b'\n' else s + b'\n' for s in bl] |
General Comments 0
You need to be logged in to leave comments.
Login now