Skip to content

Commit f02cdd8

Browse files
committed
Fix line numbering of plus lines from merge diffs.
1 parent 2e3cdd2 commit f02cdd8

File tree

1 file changed

+5
-1
lines changed

1 file changed

+5
-1
lines changed

GLFileView.m

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -414,7 +414,11 @@ + (NSString *)parseDiffChunk:(NSString *)txt
414414
}else if([prefix rangeOfString:@"+"].location != NSNotFound){
415415
[res appendString:@"<tr class='r'>"];
416416
for(int i=0; i<arity-1; i++){
417-
[res appendString:@"<td class='l'></td>"];
417+
if([prefix characterAtIndex:i] == ' '){
418+
[res appendString:[NSString stringWithFormat:@"<td class='l'>%d</td>",l_line[i]++]];
419+
}else{
420+
[res appendString:@"<td class='l'></td>"];
421+
}
418422
}
419423
[res appendString:[NSString stringWithFormat:@"<td class='r'>%d</td>",r_line++]];
420424
}else{

0 commit comments

Comments
 (0)