void () { final VirtualFile[] f = new VirtualFile[1]; executeCommand(() -> { f[0] = createChildData(myRoot, "foo.txt"); setDocumentText(f[0], "foo"); }); executeCommand(() -> setDocumentText(f[0], "foofoo")); executeCommand(() -> delete(f[0])); executeCommand(() -> f[0] = createChildData(myRoot, "foo.txt")); assertGlobalRedoNotAvailable(); assertRedoNotAvailable(getEditor(f[0])); undo(getEditor(f[0])); // should undo creation, not editing of previous document assertNull(myRoot.findChild("foo.txt")); globalUndo(); f[0] = myRoot.findChild("foo.txt"); assertNotNull(f[0]); assertEquals("foofoo", getDocumentText(f[0])); undo(getEditor(f[0])); assertEquals("foo", getDocumentText(f[0])); }