Only marker originally pointing inside the deleted region were recorded
here, and this is to make sure they regain their previous position after
the reinsertion.
I removed this part of the code to see what changes.1. I put a marker in a line2. Deleted the line3. Undo-ed the deleteThe marker is still in the proper place. So markers in the deleted string do seem to regain their position properly.