When calling edit-indirect-region on a region with overlays, edit-indirect will truncate the the overlays to their starting position. It will, however, respect overlays which are a superset of the region sent to the indirect buffer.
Simple repro (run each statement sequentially with C-x C-e)
(setq my-ol (make-overlay 10 50))
(assert (= 1 (length (overlays-at 25))))
(edit-indirect-region 10 50 (current-buffer))
;; Run edit-indirect-commit in the indirect buffer
(assert (= 1 (length (overlays-at 25)))) ;; Will fail; my-ol is now from 10 to 10
(mapcar #'delete-overlay (overlays-at 25)) ;; Cleanup
(setq my-ol (make-overlay 10 50))
(assert (= 1 (length (overlays-at 25))))
(edit-indirect-region 20 30 (current-buffer))
;; Run edit-indirect-commit in the indirect buffer
(assert (= 1 (length (overlays-at 25)))) ;; Will pass
(mapcar #'delete-overlay (overlays-at 25)) ;; Cleanup
When calling edit-indirect-region on a region with overlays, edit-indirect will truncate the the overlays to their starting position. It will, however, respect overlays which are a superset of the region sent to the indirect buffer.
Simple repro (run each statement sequentially with C-x C-e)