static S lineAtCaret(JTextComponent tc) { Pair p = textAndCaretPosition(tc); ret getLine(p.a, charIndexToUserLineNr(p.a, p.b)); }