Make selections be invalidated when text is modified within

the selection. Also handle the case that even though the content height
is the same the selection needs to move up since it should follow the
text. I suspect this code to have missing bits