diff kitten: Fix incorrect syntax highlighting with a few file formats such as yaml

This commit is contained in:
Kovid Goyal
2018-05-24 15:00:26 +05:30
parent 2e07159461
commit 219d3161d9

View File

@@ -57,7 +57,7 @@ class DiffFormatter(Formatter):
def format(self, tokensource, outfile):
for ttype, value in tokensource:
not_found = True
if value != '\n':
if value.rstrip('\n'):
while ttype and not_found:
tok = self.styles.get(ttype)
if tok is None: