void () { String text = """ this is line 1 this is line 2 this is line 3 this is line 4 this is line 5"""; init(71, text, 10); VisualPosition changePosition = new VisualPosition(1, 0); getEditor().getCaretModel().moveToVisualPosition(changePosition); int logicalLinesBefore = getEditor().offsetToLogicalPosition(text.length()).line; int offsetBefore = getEditor().getCaretModel().getOffset(); LogicalPosition logicalPositionBefore = getEditor().visualToLogicalPosition(changePosition); assertEquals(1, EditorUtil.getSoftWrapCountAfterLineStart(getEditor(), logicalPositionBefore)); assertTrue(logicalPositionBefore.column > 0); SoftWrap softWrap = getSoftWrapModel().getSoftWrap(offsetBefore); assertNotNull(softWrap); type('a'); LogicalPosition logicalPositionAfter = getEditor().visualToLogicalPosition(changePosition); assertEquals(new LogicalPosition(1, 0), logicalPositionAfter); assertEquals(offsetBefore + softWrap.getText().length() + 1, getEditor().getCaretModel().getOffset()); assertEquals(logicalLinesBefore + 1, getEditor().offsetToLogicalPosition(text.length()).line); }