public EditorState(IEnumerable<IFormulaToken> tokens, int caretIndex, int selectionLength) { Tokens = tokens == null ? null : tokens.ToList(); CaretIndex = caretIndex; SelectionLength = selectionLength; }