Yes it seem ScanRanges(False) should be correct. I cant think of any current markup that would break....
So maybe the notify should be done before ScanRange !? Or call ScanRange(false).
Looking at the code....
It seems that
FLines.SendNotification(senrHighlightChanged, FLines, -1, -1);
may never have been meant as "the highlighter was replaced"
It may go with the comment
// There may not have been a scan
meaning, it simply simulates the event for a full scan of the HL (in case it is needed)
In that case the order is correct, or does at least no matter.
Something else:
fMarkupHighCaret.Highlighter := Value;
fMarkupWordGroup.Highlighter := Value;
SynEdit shouldnt need to know individual markups.
One way would be to introduce senrHighlighterClassChanged.
But easier will be to put HighlighterChanged() the base class, and call MarkupManager.HighlighterChanged, that will call all Markups.
Any Markup in need of a HL, can react (the 2 existing Markup can retrieve the HL)