• zeripath's avatar
    Prevent off-by-one error on comments on newly appended lines (#18029) · fb5f7791
    zeripath authored
    
    
    * Prevent off-by-one error on comments on newly appended lines
    
    There was a bug in CutDiffAroundLine whereby if a file without a terminal new line
    has a patch which appends lines to it and a comment is placed on one of those lines
    the comment diff will be a line out of place.
    
    This fixes CutDiffAroundLine to simply ignore the missing terminal newline - however,
    we should really improve this rendering to add a marker to say that there was a
    previously missing terminal newline.
    
    Fix #17875
    Signed-off-by: default avatarAndrew Thornton <art27@cantab.net>
    fb5f7791
diff_test.go 5.98 KB