示例#1
0
        //////////////////////////////////////////////////////////////////////////////

        #region Autocomplete

        public string DoAutoComplete(string line, int index, bool isDoubleTab)
        {
            try
            {
                CTerminalAutocompletion.Result result = CTerminalAutocompletion.Autocomplete(line, index);

                if (isDoubleTab && result.suggestions != null)
                {
                    Add(CCommand.Prompt(line));
                    Add(result.suggestions);
                }

                return result.line;
            }
            catch (CCommandAutoCompleteException e)
            {
                Add(CCommand.Prompt(line));
                Add(e.InnerException, "Exception while auto completing args");
            }
            catch (Exception e)
            {
                Add(CCommand.Prompt(line));
                Add(e, "Inner command auto completion error");
            }

            return null;
        }