void () { configureFromFileText("x.txt", "xxx <caret>\nyyy\n"); type(' '); FileDocumentManager.getInstance().saveAllDocuments(); checkResultByText("xxx <caret>\nyyy\n"); // caret in the way getEditor().getCaretModel().moveToOffset(getEditor().getDocument().getText().indexOf("yyy")); FileDocumentManager.getInstance().saveAllDocuments(); checkResultByText("xxx\n<caret>yyy\n"); // now we can strip }