Пример #1
0
        //append_charは、インテリセンス起動元が文字入力であるときその文字、Ctrl+.などの直接起動であるとき\0
        private void PopupMain(char append_char)
        {
            IShellScheme  ss  = GetTerminalSettings().ShellScheme;
            StringBuilder buf = new StringBuilder();

            buf.Append(_currentCommand);
            if (append_char != '\0')
            {
                buf.Append(append_char);
            }

            string line = buf.ToString();

            string[] args = ss.ParseCommandInput(line);
            //(一旦廃止)日本語が入っているとCaretColumnで探すとアウトになる。根本的に直すにはコマンドパーサがGLineの内部を知っていないといけない
            //int cc = _terminal.GetDocument().CaretColumn;
            IntelliSenseMode mode = line.Length == 0 || ss.IsDelimiter(line[line.Length - 1]) ? IntelliSenseMode.ArgComplement : IntelliSenseMode.CharComplement;

            _context.Init(_terminal, ss, args, mode, append_char);
            if (!_context.IsEmpty)
            {
                if (_intelliSenseWindow == null)
                {
                    _intelliSenseWindow = new IntelliSenseWindow(); //遅延作成
                }
                _intelliSenseWindow.Popup(_context);
            }
        }
Пример #2
0
 public void UpdateCommandList(string command)
 {
     if (_scheme == null)
     {
         return; //関連付けられたものがないときは何もしない
     }
     string[] cmds = _scheme.ParseCommandInput(command);
     if (cmds.Length > 0)
     {
         Debug.WriteLineIf(DebugOpt.IntelliSense, "Update Command " + command);
         _scheme.CommandHistory.UpdateItem(cmds);
     }
 }