WoW, for something that appears to be simple, and most ways is looking like it's the problem of solving world hunger!
Let's see, hmm. If it were me, I would take advantage of the object pointers in the stringlist that represent the lines in the memo and assign them to an index for the other memo.
At least that way, they would be in sync to some degree!
But memos don't scroll by line, they scroll by caret (i.e. point x,y) position... I think you can get at how many lines are actually being displayed but the whole thing is uncomfortable (and I've looked at this several times in the context of stabilising a TMemo being used for status information etc. hence my earlier link).
Stepping back from the scrolling for a moment: I'm uncomfortable with this, but could see a situation where some sort of extraction of the texts' AI-style "tokens", i.e. smallest significant fragments, often (but by no means always) words, might be relevant. That would make the problem /potentially/ one of highlighting equivalent tokens in the two texts irrespective of the mutual ordering which again reminds me of Meld and Heckel's algorithm ** hence
https://upload.wikimedia.org/wikipedia/commons/3/30/Meld_file1.pngNow that illustration doesn't show exchanged blocks but I believe Meld handles them intelligently... the underlying algorithm certainly does (although I last used it pre-GUI with different fonts on an Epson dot-matrix indicating "here" vs "there"). ***
So if we actually assume the tentative use of TRichMemo to get text highlighting etc., the next question is: is there a better control on which to base this sort of thing, or could one be written relatively easily?
** The significance of Heckel's algorithm in this context is that it works by finding unique lines that match, then growing larger blocks outwards from those points as long as there are adjacent matching (albeit non-unique) lines. I suspect that something similar would work for texts in different languages, i.e. find unique matching tokens and grow outwards.
*** Updated: I'm wrong, it doesn't. Which is unfortunate since I believe the underlying algorithm is capable of it... unless of course the programmers fluffed a difficult implementation.
MarkMLl