The grep operator is a loop over each item, so we've effectly got nested loops, and that should nearly always be a danger sign. While that works for our input data as well, we'll run into trouble on more general data. Correct output, and reasonably efficient. And then we come to the problem of telling the difference between two sequences, where the ordering matters. There are a number of interfaces.
Changed material shows up as a series of deletes followed by a series of inserts.
As this isn't the actual value, I need to take the index and look it up in the appropriate array. The printf operation lines up the columns nicely. Let's color-code all deletions in red, and insertions in green. The only oddness now is that I need to make one final call to colorshow with the uncolored tag to close off any final begin-font tag. This call is harmless if we were already outside a colored region.