diff --git a/GLFileView.m b/GLFileView.m
index f9d7086..decb261 100644
--- a/GLFileView.m
+++ b/GLFileView.m
@@ -226,19 +226,22 @@
+ (NSString *) parseDiff:(NSString *)txt
{
txt=[self parseHTML:txt];
-
+
NSArray *lines = [txt componentsSeparatedByString:@"\n"];
NSString *line;
NSMutableString *res=[NSMutableString string];
BOOL inDiff=FALSE;
- int i=0;
- line=[lines objectAtIndex:i++];
- while(i<[lines count]){
+ BOOL inBlock=FALSE;
+
+ int l_int,l_line,l_end;
+ int r_int,r_line,r_end;
+ int i;
+ for (i=0; i<[lines count]; i++) {
+ line=[lines objectAtIndex:i];
+
if([GLFileView isStartBlock:line]){
-
- int l_int,l_line,l_end;
- int r_int,r_line,r_end;
-
+ [res appendString:@"
"];
+ inDiff=FALSE;
NSString *header=[line substringFromIndex:3];
NSRange hr = NSMakeRange(0, [header rangeOfString:@" @@"].location);
header=[header substringWithRange:hr];
@@ -254,34 +257,27 @@
r_end=r_line+[[pos_r objectAtIndex:1]integerValue];
[res appendString:[NSString stringWithFormat:@"",line]];
-
- do{
- line=[lines objectAtIndex:i++];
- NSString *s=[line substringToIndex:1];
-
- if([s isEqualToString:@" "]){
- [res appendString:[NSString stringWithFormat:@"| %d | %d | ",l_line++,r_line++]];
- }else if([s isEqualToString:@"-"]){
- [res appendString:[NSString stringWithFormat:@"
| %d | | ",l_line++]];
- }else if([s isEqualToString:@"+"]){
- [res appendString:[NSString stringWithFormat:@"
| %d | ",r_line++]];
- }
- [res appendString:[NSString stringWithFormat:@"%@ |
",line]];
- //NSLog(@"%@ %d(%d)-%d(%d)",s,l_line,(l_int+l_count),r_line,(r_int+r_count));
- }while((l_line%d | %d | ",l_line++,r_line++]];
+ }else if([s isEqualToString:@"-"]){
+ [res appendString:[NSString stringWithFormat:@"| %d | | ",l_line++]];
+ }else if([s isEqualToString:@"+"]){
+ [res appendString:[NSString stringWithFormat:@"
| %d | ",r_line++]];
+ }
+ [res appendString:[NSString stringWithFormat:@"%@ |
",[line substringFromIndex:1]]];
+ if(!(l_line"];
inDiff=TRUE;
[res appendString:@"| "];
- do{
- [res appendString:[NSString stringWithFormat:@" %@ ",line]];
- line=[lines objectAtIndex:i++];
- }while(![GLFileView isStartBlock:line]);
- [res appendString:@" |
"];
- }else{
- line=[lines objectAtIndex:i++];
+ [res appendString:[NSString stringWithFormat:@"%@
",line]];
+ }else if(inDiff){
+ [res appendString:[NSString stringWithFormat:@"%@
",line]];
}
}
if(inDiff)
diff --git a/html/views/diff/diffWindow.css b/html/views/diff/diffWindow.css
index fbe0f9e..d752659 100644
--- a/html/views/diff/diffWindow.css
+++ b/html/views/diff/diffWindow.css
@@ -3,8 +3,7 @@ table.diff {
border: 1px solid #8f8f8f;
width: 100%;
border-collapse: collapse;
- margin-right: 5px;
- margin-left: 5px;
+ margin-bottom: 10px;
}
table.diff tr td {
@@ -48,17 +47,14 @@ table.diff thead tr td p {
margin: 0;
}
-#diff table.diff thead {
- background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, rgba(244, 244, 244,1)), color-stop(1, rgba(215,215,215,1)));
+table.diff thead {
+ background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, rgba(206,206,206,1)), color-stop(1, rgba(166,166,166,1)));
}
-#diff table.diff thead tr td {
+table.diff thead tr td {
padding: 5px;
}
-#diff table.diff tbody tr.header {
- background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, rgba(206,206,206,1)), color-stop(1, rgba(166,166,166,1)));
-/* Saf4
-
-+, Chrome */
+table.diff tbody tr.header {
+ background-image: -webkit-gradient(linear,left top,left bottom, color-stop(0, rgba(244, 244, 244,1)), color-stop(1, rgba(215,215,215,1)));
}
\ No newline at end of file