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

HandleDownArrow() private method

private HandleDownArrow ( RichCommandLineContext context ) : void
context RichCommandLineContext
return void
        private void HandleDownArrow(RichCommandLineContext context)
        {
            if (context.HistoryManager.Values.Count == 0)
            {
                return;
            }

            context.Console.CursorLeft = context.ConsoleStartLeft;
            context.HistoryManager.Index--;
            if (context.HistoryManager.Index < 0)
            {
                context.HistoryManager.Index = context.HistoryManager.Values.Count - 1;
            }

            var newChars = context.HistoryManager.Values[context.HistoryManager.Index];
            context.ReplaceConsole(newChars);
            context.Intercept = true;
        }