private void PushState(Stack<EditorState> stack) { try { stack.Push(new EditorState(Tokens, CaretIndex, SelectionLength)); } catch (Exception) { return; } }