@Override
  public void beforeCharDeleted(char c, PsiFile file, Editor editor) {
    isTripleQuote = false;
    if (c == '"' || c == '\'' && CodeInsightSettings.getInstance().AUTOINSERT_PAIR_QUOTE) {
      final QuoteHandler quoteHandler = TypedHandler.getQuoteHandler(file, editor);
      if (!(quoteHandler instanceof BaseQuoteHandler)) return;

      final int offset = editor.getCaretModel().getCurrentCaret().getOffset();
      CharSequence text = editor.getDocument().getCharsSequence();
      boolean mayBeTripleQuote = offset >= 3 && offset + 2 < text.length();
      if (mayBeTripleQuote) {
        final int quoteOffset = offset - 1;
        HighlighterIterator iterator = editor.getHighlighter().createIterator(quoteOffset);
        boolean hasTripleQuoteAfter = offset + 2 < text.length() &&
                                      text.charAt(offset) == c && text.charAt(offset + 1) == c && text.charAt(offset + 2) == c;
        isTripleQuote = quoteHandler.isOpeningQuote(iterator, quoteOffset) && hasTripleQuoteAfter;
      }
    }
  }
@Override
  public void beforeCharDeleted(char c, PsiFile file, Editor editor)