void (@NotNull List<? extends CaretState> caretStates) { if (caretStates.size() < 1) throw new IllegalArgumentException("Empty list"); CaretState state = caretStates.get(0); if (state != null) { if (state.getCaretPosition() != null) moveToLogicalPosition(state.getCaretPosition()); if (state.getSelectionStart() != null && state.getSelectionEnd() != null) { myEditor.getSelectionModel().setSelection(myEditor.logicalPositionToOffset(state.getSelectionStart()), myEditor.logicalPositionToOffset(state.getSelectionEnd())); } } }