PowerArgs.Cli.BackspaceAndDeleteKeysHandler.HandleBackspace C# (CSharp) Method

HandleBackspace() private method

private HandleBackspace ( RichCommandLineContext context ) : void
context RichCommandLineContext
return void
        private void HandleBackspace(RichCommandLineContext context)
        {
            context.Intercept = true;

            if(context.BufferPosition == 0)
            {
                return;
            }

            context.BufferPosition--;

            if (context.BufferPosition < context.Buffer.Count)
            {
                context.Buffer.RemoveAt(context.BufferPosition);
                context.RefreshConsole(-1, 0);
            }
        }
BackspaceAndDeleteKeysHandler