void () { // There was a problem that soft wraps cache updated on document modification didn't contain information about removed // fold region but fold model still provided cached information about it. String text = """ package org; @SuppressWarnings("all") class Test { }"""; init(100, text); int startOffset = text.indexOf("@"); int endOffset = text.indexOf("class") - 1; addCollapsedFoldRegion(startOffset, endOffset, "xxx"); // Delete collapsed fold region that starts logical line. getEditor().getSelectionModel().setSelection(startOffset, endOffset); delete(); assertEquals(startOffset, getEditor().logicalPositionToOffset(getEditor().visualToLogicalPosition(new VisualPosition(2, 0)))); }