In the test below, this happened for a linked segment. I didn't test unlinked segments, but guess that it behaves the same for them too.
Steps to reproduce:
At some point when this happened the first time, RG did crash...and I should add, for only the second time for me in years (as per a post in bug #1725). On restarting the session, RG was not aware of the crash...and although uncertain, I don't think anything was lost anyway...perhaps timing? Repeating the steps did not reproduce the crash, but the behavior of the missing section is reproducible.
The onus might be on the user to close and reopen the Matrix Editor, but under other circumstances RG automatically closes the Editor when a relevant segment is deleted. And without closing, the revert of the missing section is not noticeable from that particular instance of the Matrix Editor, and notes are never added there again obviously, even to the same reverted segment. It's possible that the crash was related to continuing to work outside of the Matrix Editor on the reverted segment or a new one added in its place, and another editor opened on those...but that is just a guess.
I don't think this is a bug.
The undo function guarantees (hopefully) the status of the song (document). It does not necessarily guarantee the status of the editors. When the segment is deleted it is removed from the matrix editor. On undo the segment is restored. The matrix editor must be opened on the track again to get all the segments included.
This should be doable by having matrix keep a master list of the segment IDs (see
Segment::m_runtimeSegmentId) it was launched with. Then monitor to see if any come and go when the document changes.Last edit: Ted Felix 2025-07-01
I normally reopen the Matrix Editor, so it's not a problem, but this time the editor was hidden behind the main window.
However, RG did crash around that time (not reproducible), and since crashes are so rare it's possibly related. I will most likely go back to my original workflow of ensuring that the editor is reopened on segment deletion. Feel free to close this bug if it's to be considered an acceptable feature.
Yes the
runtimeSegmentIdshould make this possible - but still not trivial. The notation editor would have to do it too.But I think this is feature creep for the undo functionality. Where does it stop - should undo take back preference changes ? What about restoring window geometry ? etc.
If the crash can be reproduced that would be far more important.