@Override
  public void documentChanged(@NotNull DocumentEvent event) {
    int startLine = myDocument.getLineNumber(event.getOffset());
    int newEndLine = getAdjustedLineNumber(event.getOffset() + event.getNewLength());
    invalidateLines(startLine, myDocumentChangeOldEndLine, newEndLine, true,
                    LineLayout.isBidiLayoutRequired(event.getNewFragment()));

    if (myLines.size() != myDocument.getLineCount()) {
      LOG.error("Error updating text layout cache after " + event,
                new Attachment("editorState.txt", myView.getEditor().dumpState()));
      resetToDocumentSize(true);
    }
  }
@Override
  public void documentChanged(@NotNull DocumentEvent event)