@Override
  public void documentChanged(@NotNull DocumentEvent event) {
    try {
      if (event.getDocument().isInBulkUpdate()) return;
      validateAffectedCustomRegions();
      if (DocumentEventUtil.isMoveInsertion(event)) {
        myFoldTree.rebuild();
      }
      else {
        updateCachedOffsets();
      }
    }
    finally {
      myDocumentChangeProcessed = true;
    }
  }
@Override
  public void documentChanged(@NotNull DocumentEvent event)