Skip to content

Commit cb224cb

Browse files
committed
Merge remote branch 'refs/remotes/kamal/experimental'
2 parents a97f608 + 56a38e2 commit cb224cb

File tree

2 files changed

+13
-3
lines changed

2 files changed

+13
-3
lines changed

GLFileView.m

Lines changed: 9 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -431,6 +431,7 @@ - (NSString *) parseBlame:(NSString *)txt
431431
line=[lines objectAtIndex:i];
432432
NSArray *header=[line componentsSeparatedByString:@" "];
433433
if([header count]==4){
434+
NSString *commitID = (NSString *)[header objectAtIndex:0];
434435
int nLines=[(NSString *)[header objectAtIndex:3] intValue];
435436
[res appendFormat:@"<tr class='block l%d'>\n",nLines];
436437
line=[lines objectAtIndex:++i];
@@ -443,16 +444,21 @@ - (NSString *) parseBlame:(NSString *)txt
443444
summary=[line stringByReplacingOccurrencesOfString:@"summary" withString:@""];
444445
}
445446
}
446-
NSRange trunc={0,30};
447+
NSRange trunc_c={0,7};
448+
NSString *truncate_c=commitID;
449+
if([commitID length]>8){
450+
truncate_c=[commitID substringWithRange:trunc_c];
451+
}
452+
NSRange trunc={0,22};
447453
NSString *truncate_a=author;
448-
if([author length]>30){
454+
if([author length]>22){
449455
truncate_a=[author substringWithRange:trunc];
450456
}
451457
NSString *truncate_s=summary;
452458
if([summary length]>30){
453459
truncate_s=[summary substringWithRange:trunc];
454460
}
455-
NSString *block=[NSString stringWithFormat:@"<td><p class='author'>%@</p><p class='summary'>%@</p></td>\n<td>\n",truncate_a,truncate_s];
461+
NSString *block=[NSString stringWithFormat:@"<td><p class='author'><a href='' onclick='selectCommit(\"%@\"); return false;'>%@</a> %@</p><p class='summary'>%@</p></td>\n<td>\n",commitID,truncate_c,truncate_a,truncate_s];
456462
[headers setObject:block forKey:[header objectAtIndex:0]];
457463
}
458464
[res appendString:[headers objectForKey:[header objectAtIndex:0]]];

html/views/blame/blame.js

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -13,3 +13,7 @@ var showFile = function(txt) {
1313
SyntaxHighlighter.highlight();
1414
return;
1515
}
16+
17+
var selectCommit = function(a) {
18+
Controller.selectCommit_(a);
19+
}

0 commit comments

Comments
 (0)