diff kitten: Do not specify the default foreground color in formatting codes.

Fixes an issue with foreground color being incorrect after a highlighted
segment if the syntax highlight does not specify a foreground color at
the boundary.
This commit is contained in:
Kovid Goyal
2018-05-20 08:51:41 +05:30
parent 709d19119d
commit 9cab8a2de5
3 changed files with 12 additions and 4 deletions

View File

@@ -69,7 +69,10 @@ class Chunk:
def finalize(self):
if not self.is_context and self.left_count == self.right_count:
self.centers = tuple(changed_center(left_lines[self.left_start + i], right_lines[self.right_start + i]) for i in range(self.left_count))
self.centers = tuple(
changed_center(left_lines[self.left_start + i], right_lines[self.right_start + i])
for i in range(self.left_count)
)
def __repr__(self):
return 'Chunk(is_context={}, left_start={}, left_count={}, right_start={}, right_count={})'.format(