Browse code

bugfix: sometimes the highlighting of the maching parens was wrong, because redata_searchbackwards() was not searchching correctly if position was the second byte of the chunk and the searched element was in the first byte (it skipped that occurrence)

Dario Rodriguez authored on 06/10/2022 10:29:52
Showing 1 changed files
... ...
@@ -1630,6 +1630,10 @@ redata_searchbackwards(redata_t *redata, long posini, char *str, int len)
1630 1630
                 return(posini); /* nothing to do, empty string is always equal */
1631 1631
         if(redata_getposptr(redata,posini,&numchunk,&offset)!=0)
1632 1632
                 return(-1); /* couldn't get pos */
1633
+        while((numchunk+1)<redata->sizechunks && offset==redata->chunks[numchunk]->useddata) {
1634
+                numchunk++;
1635
+                offset=0;
1636
+        }
1633 1637
         chunkstartpos=posini-offset;
1634 1638
         for(offset++;numchunk>=0
1635 1639
           ;numchunk--