Fix tab autocompletion when no result is found

When no result is found, tab-complete result should be ignored. Bug
report by c0dei.
This commit is contained in:
ORelio 2015-07-21 16:46:41 +02:00
parent 546119a334
commit 1e801ad415

View file

@ -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); }