From 1e801ad415e9518d213292054dbc0884416e5afb Mon Sep 17 00:00:00 2001 From: ORelio Date: Tue, 21 Jul 2015 16:46:41 +0200 Subject: [PATCH] Fix tab autocompletion when no result is found When no result is found, tab-complete result should be ignored. Bug report by c0dei. --- MinecraftClient/ConsoleIO.cs | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/MinecraftClient/ConsoleIO.cs b/MinecraftClient/ConsoleIO.cs index 7e81590a..1272de20 100644 --- a/MinecraftClient/ConsoleIO.cs +++ b/MinecraftClient/ConsoleIO.cs @@ -175,9 +175,8 @@ namespace MinecraftClient string[] tmp = buffer.Split(' '); if (tmp.Length > 0) { - string word_tocomplete = tmp[tmp.Length - 1]; string word_autocomplete = autocomplete_engine.AutoComplete(buffer); - if (!String.IsNullOrEmpty(word_autocomplete) && word_autocomplete != word_tocomplete) + if (!String.IsNullOrEmpty(word_autocomplete) && word_autocomplete != buffer) { while (buffer.Length > 0 && buffer[buffer.Length - 1] != ' ') { RemoveOneChar(); } foreach (char c in word_autocomplete) { AddChar(c); }