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.

drh 2021-09-10 23:50 trunk
Commit 674da6424a5a5faf85029f38d339aac92e2a125dfb0ed6aebbc0449ecc875bc1
1 file changed +9 -1
+9 -1
--- src/diff.c
+++ src/diff.c
@@ -2092,11 +2092,19 @@
20922092
a += skip;
20932093
b += skip;
20942094
m = R[r] - skip;
20952095
if( r ) skip -= nContext;
20962096
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
+ }
20982106
}
20992107
for(j=0; j<m; j++){
21002108
pBuilder->xCommon(pBuilder, &A[a+j]);
21012109
}
21022110
a += m;
21032111
--- 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

Keyboard Shortcuts

Open search /
Next entry (timeline) j
Previous entry (timeline) k
Open focused entry Enter
Show this help ?
Toggle theme Top nav button