void () { String text = """ 1. just a line that is long enough to be soft wrapped 2. just a line that is long enough to be soft wrapped 3. just a line that is long enough to be soft wrapped 4. just a line that is long enough to be soft wrapped"""; init(15, text); CaretModel caretModel = getEditor().getCaretModel(); caretModel.moveToOffset(text.indexOf("2.") + 2); new CommentByLineCommentAction().actionPerformedImpl(getProject(), getEditor()); assertEquals(getEditor().offsetToLogicalPosition(text.indexOf("3.") + 2), caretModel.getLogicalPosition()); }