void () { String text = """ this is a string that starts with white space and is long enough to be soft-wrapped this is a 'prefix' text before collapsed multi-line folding that is long enough to be soft-wrapped first fold line second fold line"""; init(30, text); addCollapsedFoldRegion(text.indexOf("first fold line"), text.length(), "..."); List<? extends SoftWrap> softWraps = getSoftWrapModel().getRegisteredSoftWraps(); assertTrue(!softWraps.isEmpty()); CaretModel caretModel = getEditor().getCaretModel(); SoftWrap softWrap = softWraps.get(0); // Test non-smart home getEditor().getSettings().setSmartHome(false); caretModel.moveToOffset(softWrap.getStart() + 1); int visLine = caretModel.getVisualPosition().line; home(); assertEquals(new VisualPosition(visLine, 0), caretModel.getVisualPosition()); caretModel.moveToOffset(text.length()); home(); visLine = caretModel.getVisualPosition().line; assertEquals(new VisualPosition(visLine, 0), caretModel.getVisualPosition()); }