Fossil SCM
Fix highlight algorithm when used in combination with "Ignore Whitespace"
Commit
c23190a61d7794b7935bbef1b00eee3377f80c85
Parent
a8e3ede965cf285…
1 file changed
+4
-4
+4
-4
| --- src/diff.c | ||
| +++ src/diff.c | ||
| @@ -766,13 +766,13 @@ | ||
| 766 | 766 | int aLCS[4]; /* Bounds of common middle segment */ |
| 767 | 767 | static const char zClassRm[] = "<span class=\"diffrm\">"; |
| 768 | 768 | static const char zClassAdd[] = "<span class=\"diffadd\">"; |
| 769 | 769 | static const char zClassChng[] = "<span class=\"diffchng\">"; |
| 770 | 770 | |
| 771 | - nLeft = pLeft->h & LENGTH_MASK; | |
| 771 | + nLeft = pLeft->n; | |
| 772 | 772 | zLeft = pLeft->z; |
| 773 | - nRight = pRight->h & LENGTH_MASK; | |
| 773 | + nRight = pRight->n; | |
| 774 | 774 | zRight = pRight->z; |
| 775 | 775 | nShort = nLeft<nRight ? nLeft : nRight; |
| 776 | 776 | |
| 777 | 777 | nPrefix = 0; |
| 778 | 778 | while( nPrefix<nShort && zLeft[nPrefix]==zRight[nPrefix] ){ |
| @@ -914,12 +914,12 @@ | ||
| 914 | 914 | unsigned char aFirst[256]; /* aFirst[X] = index in zB[] of first char X */ |
| 915 | 915 | unsigned char aNext[252]; /* aNext[i] = index in zB[] of next zB[i] char */ |
| 916 | 916 | |
| 917 | 917 | zA = pA->z; |
| 918 | 918 | zB = pB->z; |
| 919 | - nA = pA->h & LENGTH_MASK; | |
| 920 | - nB = pB->h & LENGTH_MASK; | |
| 919 | + nA = pA->n; | |
| 920 | + nB = pB->n; | |
| 921 | 921 | while( nA>0 && fossil_isspace(zA[0]) ){ nA--; zA++; } |
| 922 | 922 | while( nA>0 && fossil_isspace(zA[nA-1]) ){ nA--; } |
| 923 | 923 | while( nB>0 && fossil_isspace(zB[0]) ){ nB--; zB++; } |
| 924 | 924 | while( nB>0 && fossil_isspace(zB[nB-1]) ){ nB--; } |
| 925 | 925 | if( nA>250 ) nA = 250; |
| 926 | 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->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 |