public int getCaretPosition() {
   Caret c = textView.getCaret();
   return c.getDot();
 }