check whether the cursor is already at the end of the line in cmd_end