private void ReplaceCurrentLineText(string newText)
        {
            var caretIndex     = CommandLineBox.CaretIndex;
            var lineIndex      = CommandLineBox.GetLineIndexFromCharacterIndex(caretIndex);
            var characterIndex = CommandLineBox.GetCharacterIndexFromLineIndex(lineIndex);
            var textOnLine     = CommandLineBox.GetLineText(lineIndex);

            CommandLineBox.Select(characterIndex, textOnLine.Length);
            CommandLineBox.SelectedText = newText;
            CommandLineBox.Focus();
            CommandLineBox.Select(CommandLineBox.Text.Length, 0);
            CommandLineBox.ScrollToLine(lineIndex);
        }