Mono.Terminal.LineEditor.ForceCursor C# (CSharp) Method

ForceCursor() public method

public ForceCursor ( int newpos ) : void
newpos int
return void
        void ForceCursor(int newpos)
        {
            cursor = newpos;

            int actual_pos = shown_prompt.Length + TextToRenderPos(cursor);
            int row = home_row + (actual_pos / Console.WindowWidth);
            int col = actual_pos % Console.WindowWidth;

            if (row >= Console.BufferHeight)
                row = Console.BufferHeight - 1;
            Console.SetCursorPosition(col, row);

            //log.WriteLine ("Going to cursor={0} row={1} col={2} actual={3} prompt={4} ttr={5} old={6}", newpos, row, col, actual_pos, prompt.Length, TextToRenderPos (cursor), cursor);
            //log.Flush ();
        }