Fossil SCM

Fix highlight algorithm when used in combination with "Ignore Whitespace"

jan.nijtmans 2014-04-03 07:05 UTC trunk
Commit c23190a61d7794b7935bbef1b00eee3377f80c85
1 file changed +4 -4
+4 -4
--- src/diff.c
+++ src/diff.c
@@ -766,13 +766,13 @@
766766
int aLCS[4]; /* Bounds of common middle segment */
767767
static const char zClassRm[] = "<span class=\"diffrm\">";
768768
static const char zClassAdd[] = "<span class=\"diffadd\">";
769769
static const char zClassChng[] = "<span class=\"diffchng\">";
770770
771
- nLeft = pLeft->h & LENGTH_MASK;
771
+ nLeft = pLeft->n;
772772
zLeft = pLeft->z;
773
- nRight = pRight->h & LENGTH_MASK;
773
+ nRight = pRight->n;
774774
zRight = pRight->z;
775775
nShort = nLeft<nRight ? nLeft : nRight;
776776
777777
nPrefix = 0;
778778
while( nPrefix<nShort && zLeft[nPrefix]==zRight[nPrefix] ){
@@ -914,12 +914,12 @@
914914
unsigned char aFirst[256]; /* aFirst[X] = index in zB[] of first char X */
915915
unsigned char aNext[252]; /* aNext[i] = index in zB[] of next zB[i] char */
916916
917917
zA = pA->z;
918918
zB = pB->z;
919
- nA = pA->h & LENGTH_MASK;
920
- nB = pB->h & LENGTH_MASK;
919
+ nA = pA->n;
920
+ nB = pB->n;
921921
while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; }
922922
while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; }
923923
while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; }
924924
while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
925925
if( nA>250 ) nA = 250;
926926
--- src/diff.c
+++ src/diff.c
@@ -766,13 +766,13 @@
766 int aLCS[4]; /* Bounds of common middle segment */
767 static const char zClassRm[] = "<span class=\"diffrm\">";
768 static const char zClassAdd[] = "<span class=\"diffadd\">";
769 static const char zClassChng[] = "<span class=\"diffchng\">";
770
771 nLeft = pLeft->h & LENGTH_MASK;
772 zLeft = pLeft->z;
773 nRight = pRight->h & LENGTH_MASK;
774 zRight = pRight->z;
775 nShort = nLeft<nRight ? nLeft : nRight;
776
777 nPrefix = 0;
778 while( nPrefix<nShort && zLeft[nPrefix]==zRight[nPrefix] ){
@@ -914,12 +914,12 @@
914 unsigned char aFirst[256]; /* aFirst[X] = index in zB[] of first char X */
915 unsigned char aNext[252]; /* aNext[i] = index in zB[] of next zB[i] char */
916
917 zA = pA->z;
918 zB = pB->z;
919 nA = pA->h & LENGTH_MASK;
920 nB = pB->h & LENGTH_MASK;
921 while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; }
922 while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; }
923 while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; }
924 while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
925 if( nA>250 ) nA = 250;
926
--- src/diff.c
+++ src/diff.c
@@ -766,13 +766,13 @@
766 int aLCS[4]; /* Bounds of common middle segment */
767 static const char zClassRm[] = "<span class=\"diffrm\">";
768 static const char zClassAdd[] = "<span class=\"diffadd\">";
769 static const char zClassChng[] = "<span class=\"diffchng\">";
770
771 nLeft = pLeft->n;
772 zLeft = pLeft->z;
773 nRight = pRight->n;
774 zRight = pRight->z;
775 nShort = nLeft<nRight ? nLeft : nRight;
776
777 nPrefix = 0;
778 while( nPrefix<nShort && zLeft[nPrefix]==zRight[nPrefix] ){
@@ -914,12 +914,12 @@
914 unsigned char aFirst[256]; /* aFirst[X] = index in zB[] of first char X */
915 unsigned char aNext[252]; /* aNext[i] = index in zB[] of next zB[i] char */
916
917 zA = pA->z;
918 zB = pB->z;
919 nA = pA->n;
920 nB = pB->n;
921 while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; }
922 while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; }
923 while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; }
924 while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; }
925 if( nA>250 ) nA = 250;
926

Keyboard Shortcuts

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