Index: src/color.c =================================================================== --- src/color.c (revision 5245) +++ src/color.c (working copy) @@ -364,8 +364,7 @@ } } -/* Reset the multicolor info cache for records for any lines which need - * to be recalculated. */ +/* Reset the multiline coloring cache for lines that need recalculation. */ void reset_multis_after(filestruct *fileptr, int mindex) { filestruct *oof; @@ -373,23 +372,15 @@ alloc_multidata_if_needed(oof); if (oof->multidata == NULL) continue; - if (oof->multidata[mindex] != CNONE) - oof->multidata[mindex] = -1; - else + if (oof->multidata[mindex] == CENDAFTER || + oof->multidata[mindex] == CSTARTENDHERE) break; + oof->multidata[mindex] = -1; } - for (; oof != NULL; oof = oof->next) { - alloc_multidata_if_needed(oof); - if (oof->multidata == NULL) - continue; - if (oof->multidata[mindex] == CNONE) - oof->multidata[mindex] = -1; - else - break; - } edit_refresh_needed = TRUE; } +/* Reset the multiline coloring cache for lines that need recalculation. */ void reset_multis_before(filestruct *fileptr, int mindex) { filestruct *oof; @@ -397,20 +388,11 @@ alloc_multidata_if_needed(oof); if (oof->multidata == NULL) continue; - if (oof->multidata[mindex] != CNONE) - oof->multidata[mindex] = -1; - else + if (oof->multidata[mindex] == CBEGINBEFORE || + oof->multidata[mindex] == CSTARTENDHERE) break; + oof->multidata[mindex] = -1; } - for (; oof != NULL; oof = oof->prev) { - alloc_multidata_if_needed(oof); - if (oof->multidata == NULL) - continue; - if (oof->multidata[mindex] == CNONE) - oof->multidata[mindex] = -1; - else - break; - } edit_refresh_needed = TRUE; }