@Override
      public void caretPositionChanged(@NotNull CaretEvent e) {
        myEscPressed = false; // clear "Escape was pressed" flag on each caret change

        Editor editor = e.getEditor();
        if (ComponentUtil.isShowing(editor.getContentComponent(), true) && worthBothering(editor.getDocument(), editor.getProject())) {
          ApplicationManager.getApplication().invokeLater(() -> {
            if (!myProject.isDisposed() && ComponentUtil.isShowing(editor.getContentComponent(), true)) {
              IntentionsUI.getInstance(myProject).invalidateForEditor(editor);
            }
          }, ModalityState.current(), myProject.getDisposed());
        }
      }
@Override
      public void caretPositionChanged(@NotNull CaretEvent e)