Long undo chains cause text corruption
When undoing a lot of edits (maybe 20+?), at some point the cursor position or
GtkSourceView state changes so that the changes are undone in the wrong place, resulting in the old (restored) text being restored to the wrong place, and the new (undone) text being removed from the wrong place.
Once a document is corrupted this way it’s impossible to redo/undo your way out of it, and you have to drop all changes and reload from whatever’s saved to disk. This is a data loss bug.
I’m afraid I don’t have more concrete reproduction instructions than ‘undoing a lot of edits’. There must be something which triggers the mess up in state, but I haven’t figured out what.