@Override
      public void beforeDocumentChange(@NotNull DocumentEvent event) {
        if (event.getOffset() < baseCaretOffset + caretOffsetDiff[0]) {
          caretOffsetDiff[0] += event.getNewLength() - event.getOldLength();
        }

        if (autoFormatted(event)) {
          return;
        }
        wrapIntroducedSymbolsNumber[0] += event.getNewLength() - event.getOldLength();
      }
@Override
      public void beforeDocumentChange(@NotNull DocumentEvent event)