void () { initText(""); ((DocumentImpl)getEditor().getDocument()).setAcceptSlashR(true); runWriteCommand(() -> getEditor().getDocument().insertString(0, "abc\r\ndef")); getEditor().getCaretModel().moveToOffset(4); assertEquals(new LogicalPosition(0, 3), getEditor().getCaretModel().getLogicalPosition()); assertEquals(new VisualPosition(0, 3), getEditor().getCaretModel().getVisualPosition()); }