Fix visual mode downwards movement bug

Previously, if you tried to move further down the document than exist
the cursor would not move down.  This sets selectionEnd.line to be
no greater than the total length of the document.