@Override
  public synchronized void documentChanged(@NotNull DocumentEvent e) {
    try {
      Document document = e.getDocument();

      if (document.isInBulkUpdate()) {
        myText = null;
        mySegments.removeAll();
        return;
      }
      incrementalUpdate(e.getOffset(), e.getOldLength(), e.getNewLength(), document);
    }
    catch (ProcessCanceledException ex) {
      myText = null;
      mySegments.removeAll();
      throw ex;
    }
    catch (RuntimeException ex) {
      throw new InvalidStateException(this, "Error updating  after " + e, ex);
    }
  }
@Override
  public synchronized void documentChanged(@NotNull DocumentEvent e)