Exemplo n.º 1
0
        private void InsertNewLine()
        {
            ClearLastInputCommand();

            var initalText  = String.Empty;
            var currentLine = CurrentLine;

            if (currentLineOffset < currentLine.ContentLength)
            {
                var removeLength = currentLine.ContentLength - currentLineOffset;
                initalText = currentLine.content.ToString(currentLineOffset, removeLength);
                currentLine.content.Remove(currentLineOffset, removeLength);
                currentLine.ClearTokenCache();
            }

            var line = new InputLine(manager.GetPrompt());

            lines.Insert(++currentLineIndex, line);
            currentLineOffset = 0;

            if (initalText.Length > 0)
            {
                var idx = currentLineOffset;
                line.InsertLine(ref idx, initalText, 0, initalText.Length);
            }
        }         // proc InsertNewLine