Problem: Listener list not correctly updated on listener_remove().
Solution: Only set "prev" when not removing a listener. Return one if the
listener was found and removed.
Problem: ":write" increments b:changedtick even though nothing changed.
(Daniel Hahler)
Solution: Only increment b:changedtick if the modified flag is reset.
Problem: Alloc() returning "char_u *" causes a lot of type casts.
Solution: Have it return "void *". (Mike Williams) Define ALLOC_ONE() to
check the simple allocations.
Problem: Changes are not flushed when end and start overlap. (Paul Jolly)
Solution: When end of a previous changes overlaps with start of a new
change, first flush listeners.
Problem: Using "int" for alloc() often results in compiler warnings.
Solution: Use "size_t" and remove type casts. Remove alloc_check(), Vim
only works with 32 bit ints anyway.
Problem: Coverity complains about possibly using a NULL pointer and copying
a string into a fixed size buffer.
Solution: Check for NULL, even though it should not happen. Use
vim_strncpy() instead of strcpy().
Problem: Text properties don't always move after changes.
Solution: Update properties before reporting changes to listeners. Move text
property when splitting a line.
Problem: Cannot flush change listeners without also redrawing. The line
numbers in the list of changes may become invalid.
Solution: Add listener_flush(). Invoke listeners before adding a change
that makes line numbers invalid.
Problem: No docs or tests for listener functions.
Solution: Add help and tests for listener_add() and listener_remove().
Invoke the callbacks before redrawing.