Mono.Terminal.LineEditor.History.SearchBackward C# (CSharp) Method

SearchBackward() public method

public SearchBackward ( string term ) : string
term string
return string
            public string SearchBackward(string term)
            {
                for (int i = 0; i < count; i++)
                {
                    int slot = cursor - i - 1;
                    if (slot < 0)
                        slot = history.Length + slot;
                    if (slot >= history.Length)
                        slot = 0;
                    if (history[slot] != null && history[slot].IndexOf(term) != -1)
                    {
                        cursor = slot;
                        return history[slot];
                    }
                }

                return null;
            }