void () { configureByText(PlainTextFileType.INSTANCE, "aba"); final Document document = myFile.getViewProvider().getDocument(); assertNotNull(document); SmartPsiFileRange range1 = getPointerManager().createSmartPsiFileRangePointer(myFile, TextRange.create(0, 2)); SmartPsiFileRange range2 = getPointerManager().createSmartPsiFileRangePointer(myFile, TextRange.create(1, 3)); ApplicationManager.getApplication().runWriteAction(() -> { document.deleteString(0, 1); document.deleteString(1, 2); }); assertEquals(TextRange.create(0, 1), range1.getRange()); assertEquals(TextRange.create(0, 1), range2.getRange()); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); assertEquals(TextRange.create(0, 1), range1.getRange()); assertEquals(TextRange.create(0, 1), range2.getRange()); insertString(document, 0, "a"); assertEquals(TextRange.create(1, 2), range1.getRange()); assertEquals(TextRange.create(1, 2), range2.getRange()); PsiDocumentManager.getInstance(myProject).commitAllDocuments(); assertEquals(TextRange.create(1, 2), range1.getRange()); assertEquals(TextRange.create(1, 2), range2.getRange()); }