From 939d03e03de897fc610a083d85536a32308e617f Mon Sep 17 00:00:00 2001 From: v-alexjo Date: Wed, 6 Jan 2016 10:33:53 -0800 Subject: [PATCH] Removing Console.Writelines for debugging and modifying bounds chekcing --- .../readline.cs | 19 +++++-------------- 1 file changed, 5 insertions(+), 14 deletions(-) diff --git a/src/Microsoft.PowerShell.Linux.Host/readline.cs b/src/Microsoft.PowerShell.Linux.Host/readline.cs index 5876aa75ce..7cd46f1107 100644 --- a/src/Microsoft.PowerShell.Linux.Host/readline.cs +++ b/src/Microsoft.PowerShell.Linux.Host/readline.cs @@ -250,22 +250,16 @@ namespace Microsoft.PowerShell.Linux.Host try { - Console.WriteLine("CompletionMatches {0}", cmdCompleteOpt.CompletionMatches.Count); - Console.WriteLine("tabCompletionPos {0}", tabCompletionPos); if (tabCompletionPos > cmdCompleteOpt.CompletionMatches.Count || tabCompletionPos == cmdCompleteOpt.CompletionMatches.Count) - { - Console.WriteLine("in reset of tabCompleitonPos"); - tabCompletionPos = 0; + { + tabCompletionPos = 1; } - tabResult = cmdCompleteOpt.CompletionMatches[tabCompletionPos].CompletionText; - + tabResult = cmdCompleteOpt.CompletionMatches[tabCompletionPos].CompletionText; } catch (Exception e) { - Console.WriteLine("tabCompletionPos {0}", tabCompletionPos); - Console.WriteLine("in exception with e= {0}", e); return; } @@ -274,7 +268,6 @@ namespace Microsoft.PowerShell.Linux.Host //if there is a command for the user before the uncompleted option if (!String.IsNullOrEmpty(tabResult)) { - Console.WriteLine("in not null or empty"); //handle file path slashes if (tabResult.Contains(".\\")) { @@ -282,8 +275,7 @@ namespace Microsoft.PowerShell.Linux.Host } if (this.buffer.ToString().Contains(" ")) - { - Console.WriteLine("the buffer contains a space"); + { var replaceIndex = cmdCompleteOpt.ReplacementIndex; string replaceBuffer = this.buffer.ToString(); @@ -306,8 +298,7 @@ namespace Microsoft.PowerShell.Linux.Host } - BufferFromString(tabResult); - Console.WriteLine("bufferfromstring is {0}", tabResult); + BufferFromString(tabResult); this.Render(); }