Gunnar Evermann <ge204(a)eng.cam.ac.uk> writes:
Now we call report_extent_modification which calls
map_extents(from = 7, to = 8, fn = 0x1cd3f8,...)
but 7 and 8 are now outside the buffer range, therefore triggering
the assert when converting them to byteinds.
Fixing this is not trivial, but it's certainly possible. You can
avoid the crash by clipping (from, to) to legal buffer positions, but
the right fix should be to completely re-validate from and to.
The same bug happens when you call more than one before/after-change
function. We should hold an extent (or two markers) over the changed
region, and update FROM and TO as needed.
I started to do this once, but I didn't understand code in insdel.c
all that well, so the multiple-change stuff swamped me. I think I'll
try again soon.