cursorPosition must be gathered in beforeTextChanged -- it's always zero in afterTextChanged