Sun 22 Jan 2017 09:05:26 PM UTC, original submission:
To reproduce, add the following three lines to your ~/.nanorc:
syntax "2"
color brightred start="^\<" end="^201."
color green start=""" end="""
Then run 'src/nano -Y2 +7 NEWS'. Note that the year numbers are red and the release names are green. Now press M-= twice to scroll the top two lines of the file offscreen. Then press <Del>. In current git the whole 2.7.3 paragraph becomes red (except "Ontbijtkoek"), as it should, and for the rest nothing changes. Good!
If, however, you do the same exercise with version 2.7.4 or earlier, then almost /everything/ turns green, and "Ontbijtkoek" becomes red. It is almost as if it resets /all/ multidata when it should reset only the multidata for red. I don't get it.
Testing this... Yes, it actually /does/ reset the multidata for both colors. Why? ... Because in reset_multis() it doesn't look for an end match /after/ a start match, it just looks for each of them from the head of the line, and if start and end regex are equal... it will not find the second possible match and start will not be smaller than end, and thus it will /think/ things have changed and will reset the multidata. And then in the older versions it will get the backtracking wrong and color everything in the reverse manner of what is needed.
Well, even though it resets too much multidata, in the git version it gets the backtracking right and thus recolors everything correctly. No problem. Except... in the case of bug #50121: then it doesn't reset the multidata /far/ enough, it seems. Testing this... No, even when doing extra resets, or resets all the way to the end of the file, it still gets it wrong on the overnext line after the change. :(
|