Do not destroy cursors in an erased area
commitfdad53197e5870d9c7108dd4608f2f415b614cc2
authorPetr Tesarik <petr@tesarici.cz>
Tue, 2 Oct 2012 20:37:25 +0000 (2 22:37 +0200)
committerPetr Tesarik <petr@tesarici.cz>
Tue, 2 Oct 2012 20:37:25 +0000 (2 22:37 +0200)
tree2d21372896c8b58d28fd330c361c104f4336c61b
parent6f09eee79363173409a76353d7dfcd410a23334f
Do not destroy cursors in an erased area

Instead of destroying the cursors, move them to the nearest following
position. This ensures that existing cursors will never get invalidated
indirectly through the hed API. That is, if you call hed_get_cursor(),
the resulting cursor stays valid until you call hed_put_cursor() on it.

Preserving the insert point is tricky:
1. There can now be zero-sized insertion blocks with an active insert
   point, and these must not be killed.
2. It is important to slide the insertion point when erase block
   includes the end of an insertion, even if the insertion block
   itself is not erased.
libhed/file.c