@Override
  protected void processInputMethodEvent(InputMethodEvent e) {
    if (EditorImpl.EVENT_LOG.isDebugEnabled()) {
      EditorImpl.EVENT_LOG.debug(e.toString());
    }
    // Don't dispatch to super first; now that EditorComponentImpl is a JTextComponent,
    // this would have the side effect of invoking Swing document machinery which relies
    // on creating Document positions etc (and won't update the document in an IntelliJ
    // safe way, such as running through all the carets etc.).
    // First try to handle the event using the default editor logic, then dispatch to
    // `super.processInputMethodEvent(e)`, which in turn will call the listeners and
    // if still not consumed, handle the event by the default JTextComponent logic.
    //    super.processInputMethodEvent(e);

    // Viewer editors can handle input method events themselves by using `InputMethodListener`.
    if (!e.isConsumed() && !editor.isViewer()) {
      switch (e.getID()) {
        case InputMethodEvent.INPUT_METHOD_TEXT_CHANGED:
          editor.replaceInputMethodText(e);
          // No breaks over here.

        case InputMethodEvent.CARET_POSITION_CHANGED:
          editor.inputMethodCaretPositionChanged(e);
          e.consume();
          break;
      }
    }

    super.processInputMethodEvent(e);
  }
@Override
  protected void processInputMethodEvent(InputMethodEvent e)