Browse code

bugfix: rearch&replace was not replacing the last occurrences if the new string was larger than the old string and the occurrence was close to the end of the selection

Dario Rodriguez authored on 25/04/2021 10:10:41
Showing 1 changed files
... ...
@@ -1263,6 +1263,7 @@ re_processcommand(re_t *re)
1263 1263
                   ;total++,oldpos=newpos+rlen) {
1264 1264
                         redata_op_del(re->data,newpos,slen,NULL);
1265 1265
                         redata_op_add(re->data,newpos,re->cachelastreplacewith,rlen,NULL);
1266
+                        endpos=endpos-slen+rlen;
1266 1267
                 }
1267 1268
                 redata_undo_groupcommit(re->data,NULL);
1268 1269
                 redata_pos2linecol(re->data,oldpos,&(re->curline),&(re->curcol));