Fossil SCM
When computing a diff display, if the number of rows to skip between two diff regions is less than the context size, then go ahead and show the skip area as common text.
Commit
674da6424a5a5faf85029f38d339aac92e2a125dfb0ed6aebbc0449ecc875bc1
Parent
c624ed868e80289…
1 file changed
+9
-1
+9
-1
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -2092,11 +2092,19 @@ | ||
| 2092 | 2092 | a += skip; |
| 2093 | 2093 | b += skip; |
| 2094 | 2094 | m = R[r] - skip; |
| 2095 | 2095 | if( r ) skip -= nContext; |
| 2096 | 2096 | if( skip>0 ){ |
| 2097 | - pBuilder->xSkip(pBuilder, skip, 0); | |
| 2097 | + if( skip<nContext ){ | |
| 2098 | + /* If the amount to skip is less that the context band, then | |
| 2099 | + ** go ahead and show the skip band as it is not worth eliding */ | |
| 2100 | + for(j=0; j<skip; j++){ | |
| 2101 | + pBuilder->xCommon(pBuilder, &A[a+j-skip]); | |
| 2102 | + } | |
| 2103 | + }else{ | |
| 2104 | + pBuilder->xSkip(pBuilder, skip, 0); | |
| 2105 | + } | |
| 2098 | 2106 | } |
| 2099 | 2107 | for(j=0; j<m; j++){ |
| 2100 | 2108 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| 2101 | 2109 | } |
| 2102 | 2110 | a += m; |
| 2103 | 2111 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2092,11 +2092,19 @@ | |
| 2092 | a += skip; |
| 2093 | b += skip; |
| 2094 | m = R[r] - skip; |
| 2095 | if( r ) skip -= nContext; |
| 2096 | if( skip>0 ){ |
| 2097 | pBuilder->xSkip(pBuilder, skip, 0); |
| 2098 | } |
| 2099 | for(j=0; j<m; j++){ |
| 2100 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| 2101 | } |
| 2102 | a += m; |
| 2103 |
| --- src/diff.c | |
| +++ src/diff.c | |
| @@ -2092,11 +2092,19 @@ | |
| 2092 | a += skip; |
| 2093 | b += skip; |
| 2094 | m = R[r] - skip; |
| 2095 | if( r ) skip -= nContext; |
| 2096 | if( skip>0 ){ |
| 2097 | if( skip<nContext ){ |
| 2098 | /* If the amount to skip is less that the context band, then |
| 2099 | ** go ahead and show the skip band as it is not worth eliding */ |
| 2100 | for(j=0; j<skip; j++){ |
| 2101 | pBuilder->xCommon(pBuilder, &A[a+j-skip]); |
| 2102 | } |
| 2103 | }else{ |
| 2104 | pBuilder->xSkip(pBuilder, skip, 0); |
| 2105 | } |
| 2106 | } |
| 2107 | for(j=0; j<m; j++){ |
| 2108 | pBuilder->xCommon(pBuilder, &A[a+j]); |
| 2109 | } |
| 2110 | a += m; |
| 2111 |