void (final Editor editor, int offset, ScrollType scrollType) { LogicalPosition pos = editor.offsetToLogicalPosition(offset); editor.getCaretModel().moveToLogicalPosition(pos); editor.getScrollingModel().scrollToCaret(scrollType); }