void OnInspectorUpdate()
        {
            Undo.GetUndoList(m_NewUndos, out m_UndoCursor);
            // Needs undo cursor cache as well
            if (!m_LastUndos.SequenceEqual(m_NewUndos) || m_UndoCursor != m_LastUndoCursor ||
                m_History.Count == 0 || m_UndoRedoPerformed)
            {
                m_LastUndos      = m_NewUndos.ToList();
                m_LastUndoCursor = m_UndoCursor;

                for (int i = 0; i < m_NewUndos.Count; i++)
                {
                    m_NewUndos[i] = m_NewUndos[i].Replace("\n", "");
                }

                // rebuild the history list
                m_History.Clear();
                if (m_ShowLatestFirst)
                {
                    for (int i = m_NewUndos.Count - 1; i >= 0; i--)
                    {
                        m_History.Add(new HistoryItem(i < m_UndoCursor ? HistoryType.Undo : HistoryType.Redo, m_NewUndos[i], i));
                    }
                    m_History.Add(new HistoryItem(HistoryType.None, "Scene Open", -1));
                }
                else
                {
                    m_History.Add(new HistoryItem(HistoryType.None, "Scene Open", -1));
                    for (int i = 0; i < m_NewUndos.Count; i++)
                    {
                        m_History.Add(new HistoryItem(i < m_UndoCursor ? HistoryType.Undo : HistoryType.Redo, m_NewUndos[i], i));
                    }
                }

                s_Instance.m_HistoryListView.RefreshItems();
                s_Instance.ScrollToCurrent();
                m_UndoRedoPerformed = false;
            }
        }