##// END OF EJS Templates
patch: don't separate \r and \n when colorizing diff output...
Sune Foldager -
r38649:e1987261 default
parent child Browse files
Show More
@@ -2405,7 +2405,7 b' def diffsinglehunk(hunklines):'
2405 """yield tokens for a list of lines in a single hunk"""
2405 """yield tokens for a list of lines in a single hunk"""
2406 for line in hunklines:
2406 for line in hunklines:
2407 # chomp
2407 # chomp
2408 chompline = line.rstrip('\n')
2408 chompline = line.rstrip('\r\n')
2409 # highlight tabs and trailing whitespace
2409 # highlight tabs and trailing whitespace
2410 stripline = chompline.rstrip()
2410 stripline = chompline.rstrip()
2411 if line.startswith('-'):
2411 if line.startswith('-'):
@@ -2473,6 +2473,9 b' def diffsinglehunkinline(hunklines):'
2473 isendofline = token.endswith('\n')
2473 isendofline = token.endswith('\n')
2474 if isendofline:
2474 if isendofline:
2475 chomp = token[:-1] # chomp
2475 chomp = token[:-1] # chomp
2476 if chomp.endswith('\r'):
2477 chomp = chomp[:-1]
2478 endofline = token[len(chomp):]
2476 token = chomp.rstrip() # detect spaces at the end
2479 token = chomp.rstrip() # detect spaces at the end
2477 endspaces = chomp[len(token):]
2480 endspaces = chomp[len(token):]
2478 # scan tabs
2481 # scan tabs
@@ -2488,7 +2491,7 b' def diffsinglehunkinline(hunklines):'
2488 if isendofline:
2491 if isendofline:
2489 if endspaces:
2492 if endspaces:
2490 yield (endspaces, 'diff.trailingwhitespace')
2493 yield (endspaces, 'diff.trailingwhitespace')
2491 yield ('\n', '')
2494 yield (endofline, '')
2492 nextisnewline = True
2495 nextisnewline = True
2493
2496
2494 def difflabel(func, *args, **kw):
2497 def difflabel(func, *args, **kw):
General Comments 0
You need to be logged in to leave comments. Login now