private void BrowseSuggestions(int move)
        {
            int oldBrowseIdx = BrowseIdx;

            BrowseIdx = Mathf.Clamp(BrowseIdx + move, -1, Suggestions.Count - 1);
            if (BrowseIdx != oldBrowseIdx)
            {
                if (BrowseIdx < 0)
                {
                    SetInputText(UserInput, EEditMode.Auto);
                    ResetBrowse();
                }
                else
                {
                    BrowseMode = EBrowseMode.Suggestions;
                    SetInputText(ExpandSuggestion(BrowseIdx), EEditMode.Auto);
                }
            }
        }
        private void BrowseHistory(int move)
        {
            int oldBrowseIdx = BrowseIdx;

            BrowseIdx = Mathf.Clamp(BrowseIdx + move, -1, CommandHistory.Count - 1);
            if (BrowseIdx != oldBrowseIdx)
            {
                if (BrowseIdx < 0)
                {
                    SetInputText(UserInput, EEditMode.Auto);
                    ResetBrowse();
                }
                else
                {
                    BrowseMode = EBrowseMode.History;
                    SetInputText(CommandHistory[BrowseIdx], EEditMode.Auto);
                }
            }
        }
Beispiel #3
0
        private void BrowseHistory(int move)
        {
            int oldBrowseIdx = BrowseIdx;

            BrowseIdx = Mathf.Clamp(BrowseIdx + move, -1, HistoryContainer.GetNumEntries() - 1);
            if (BrowseIdx != oldBrowseIdx)
            {
                if (BrowseIdx < 0)
                {
                    SetInputText("", EEditMode.Auto);
                    ResetBrowse();
                }
                else
                {
                    BrowseMode = EBrowseMode.History;
                    var entry = HistoryContainer.GetEntry(BrowseIdx);
                    SetInputText(HistoryContainer.GetEntry(BrowseIdx), EEditMode.Auto);
                    UserInputTerms = Utils.GetCommandTerms(entry);
                    UpdateSuggestions();
                }
            }
        }
 private void ResetBrowse()
 {
     BrowseMode = EBrowseMode.None;
     BrowseIdx  = -1;
     UpdateSuggestions();
 }