Hello oBFusCATed.
Let's skip the first point even I'm confused about. But I think at the end it is not helping anybody.
It will be quite surprising if this is related to multiple files. I think the undo data structures in the editor are not shared between files - we have a wxScintilla object for every tab (if split we have two such objects).
As I wrote at the end it happens "randomly". But I faced several times that it happens when I'm stepping back to a file I have edited some time ago.
What is with my assumption that it is associated with the age of the change I want to redo?
In the documentation of Scintilla you provided via link (in the bug-report discussion) they write "... It will continue to collect undoable actions until memory runs out. ...". But they don't mention what happens when memory runs out.
Furthermore they write "... These transactions can be nested and only the top-level sequences are undone as units. ..."
Could it be that this nesting will be done with older undoable actions ?
Are you sure the lexer is set correctly. You can make .cpp/.h files to behave like plaintext files if you switch the lexer.
Actually I have not modified or changed the lexer. However, could you please provide some more details about the doubt you have in mind.
May be I have really modified it without noticing it.
Stay well and healthy,
Eckard Klotz.