PowerArgs.Cli.ArrowKeysHandler.HandleRightArrow C# (CSharp) Method

HandleRightArrow() private method

private HandleRightArrow ( RichCommandLineContext context ) : void
context RichCommandLineContext
return void
        private void HandleRightArrow(RichCommandLineContext context)
        {
            // todo - resolve special handling for the TextBox support
            if (context.Console.BufferWidth == 0)
            {
                if (context.Console.CursorLeft < context.Buffer.Count)
                {
                    context.Console.CursorLeft += 1;
                }
            }
            else
            {
                if (context.Console.CursorLeft < context.Console.BufferWidth - 1 && context.BufferPosition < context.Buffer.Count)
                {
                    context.Console.CursorLeft = context.Console.CursorLeft + 1;
                }
                else if (context.Console.CursorLeft == context.Console.BufferWidth - 1)
                {
                    context.Console.CursorTop++;
                    context.Console.CursorLeft = 0;
                }
            }

            context.Intercept = true;
        }