@Override
  public void setCaretsAndSelections(@NotNull List<? extends CaretState> caretStates, boolean updateSystemSelection) {
    if (caretStates.size() != 1) {
      LOG.error("Imaginary caret does not support multicaret. caretStates=" + caretStates);
    }
    CaretState state = caretStates.get(0);
    if (state.getCaretPosition() != null) {
      myCaret.moveToOffset(myEditor.logicalPositionToOffset(state.getCaretPosition()));
    }
    if (state.getSelectionStart() != null && state.getSelectionEnd() != null && !state.getSelectionStart().equals(state.getSelectionEnd())) {
      myCaret.setSelection(myEditor.logicalPositionToOffset(state.getSelectionStart()),
                           myEditor.logicalPositionToOffset(state.getSelectionEnd()));
    }
  }
@Override
  public void setCaretsAndSelections(@NotNull List<? extends CaretState> caretStates, boolean updateSystemSelection)