public void AddInput(string command)
            {
                // If the language buffer is readonly then input can not be added. Return immediately.
                // The language buffer gets marked as readonly in SubmitAsync method when input on the prompt
                // gets submitted. So it would be readonly when the user types #reset on the prompt. In that
                // case it is the right thing to bail out of this method.
                if (_window._currentLanguageBuffer != null && _window._currentLanguageBuffer.IsReadOnly(0))
                {
                    return;
                }

                if (State == State.ExecutingInput || _window._currentLanguageBuffer == null)
                {
                    AddLanguageBuffer();
                    _window._currentLanguageBuffer.Insert(0, command);
                }
                else
                {
                    StoreUncommittedInput();
                    _window.SetActiveCode(command);
                }

                // Add command to history before calling FinishCurrentSubmissionInput as it adds newline
                // to the end of the command.
                _window._history.Add(_window._currentLanguageBuffer.CurrentSnapshot.GetExtent());
                FinishCurrentSubmissionInput();
            }
            public void AddInput(string command)
            {
                if (State == State.ExecutingInput || _window._currentLanguageBuffer == null)
                {
                    AddLanguageBuffer();
                    _window._currentLanguageBuffer.Insert(0, command);
                }
                else
                {
                    StoreUncommittedInput();
                    _window.SetActiveCode(command);
                }

                FinishCurrentSubmissionInput();
                _window._history.Add(_window._currentLanguageBuffer.CurrentSnapshot.GetExtent());
            }
Exemple #3
0
            public void AddInput(string command)
            {
                if (State == State.ExecutingInput || _window._currentLanguageBuffer == null)
                {
                    AddLanguageBuffer();
                    _window._currentLanguageBuffer.Insert(0, command);
                }
                else
                {
                    StoreUncommittedInput();
                    _window.SetActiveCode(command);
                }

                // Add command to history before calling FinishCurrentSubmissionInput as it adds newline
                // to the end of the command.
                _window._history.Add(_window._currentLanguageBuffer.CurrentSnapshot.GetExtent());
                FinishCurrentSubmissionInput();
            }