some fixes for multiple-mode textinput

#4258 
Doesn't this mean that something like ctr+right (when we implement that) won't work on the last line if there aren't enough characters remaining?