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

HandleLeftArrow() private method

private HandleLeftArrow ( RichCommandLineContext context ) : void
context RichCommandLineContext
return void
        private void HandleLeftArrow(RichCommandLineContext context)
        {
            if (context.Console.CursorTop == context.ConsoleStartTop && context.Console.CursorLeft > context.ConsoleStartLeft)
            {
                context.Console.CursorLeft -= 1;
            }
            else if (context.Console.CursorLeft > 0)
            {
                context.Console.CursorLeft -= 1;
            }
            else if (context.Console.CursorTop > context.ConsoleStartTop)
            {
                context.Console.CursorTop--;
                context.Console.CursorLeft = context.Console.BufferWidth - 1;
            }

            context.Intercept = true;
        }