Fix cursor not re-positioning correctly on last line

Fix cursor so clicking the below the last line of text puts the cursor at the end of the last line.