@@ -347,7 +347,7 @@ diff_common_read(struct view *view, const char *data, struct diff_state *state)
347347 state -> reading_diff_chunk = false;
348348
349349 } else if (type == LINE_DIFF_CHUNK ) {
350- const int len = chunk_header_marker_length (data );
350+ const unsigned int len = chunk_header_marker_length (data );
351351 const char * context = strstr (data + len , "@@" );
352352 struct line * line =
353353 context ? add_line_text_at (view , view -> lines , data , LINE_DIFF_CHUNK , len )
@@ -362,20 +362,26 @@ diff_common_read(struct view *view, const char *data, struct diff_state *state)
362362 box -> cell [1 ].length = strlen (context + len );
363363 box -> cell [box -> cells ++ ].type = LINE_DIFF_STAT ;
364364 state -> combined_diff = (len > 2 );
365+ state -> parents = len - 1 ;
365366 state -> reading_diff_chunk = true;
366367 return true;
367368
368369 } else if (type == LINE_COMMIT ) {
369370 state -> reading_diff_chunk = false;
370371
371- } else if (state -> highlight && strchr (data , 0x1b )) {
372- return diff_common_highlight (view , data , type );
372+ }
373373
374- } else if (opt_word_diff && state -> reading_diff_chunk &&
375- /* combined diff format is not using word diff */
376- !state -> combined_diff ) {
374+ if (opt_word_diff && state -> reading_diff_chunk &&
375+ /* combined diff format is not using word diff */
376+ !state -> combined_diff )
377377 return diff_common_read_diff_wdiff (view , data );
378- }
378+
379+ if (!opt_diff_indicator && state -> reading_diff_chunk &&
380+ !state -> stage )
381+ data += state -> parents ;
382+
383+ if (state -> highlight && strchr (data , 0x1b ))
384+ return diff_common_highlight (view , data , type );
379385
380386 return pager_common_read (view , data , type , NULL );
381387}
0 commit comments