void undoChange() {
      Project project = myFile.getProject();
      VirtualFile virtualFile = myFile.getVirtualFile();
      FileEditorManager fileEditorManager = FileEditorManager.getInstance(project);
      FileEditor fileEditor = virtualFile != null ? fileEditorManager.getSelectedEditor(virtualFile) : null;
      UndoManager manager = UndoManager.getInstance(project);
      if (fileEditor != null && manager.isUndoAvailable(fileEditor)) {
        manager.undo(fileEditor);
      }
      else {
        WriteCommandAction.writeCommandAction(project, myFile)
          .withName(myActionName)
          .run(() -> myDocument.replaceString(myMarker.getStartOffset(), myMarker.getEndOffset(), myOriginalText));
      }
    }
void undoChange()