void (@NotNull InputMethodEvent e) { if (composedText != null) { int dot = composedTextRange.getStartOffset(); TextHitInfo caretPos = e.getCaret(); if (caretPos != null) { dot += caretPos.getInsertionIndex(); } getCaretModel().moveToOffset(dot); getScrollingModel().scrollToCaret(ScrollType.RELATIVE); } }