aboutsummaryrefslogtreecommitdiffhomepage
path: root/src/AutoComplete.cxx
diff options
context:
space:
mode:
Diffstat (limited to 'src/AutoComplete.cxx')
-rw-r--r--src/AutoComplete.cxx4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/AutoComplete.cxx b/src/AutoComplete.cxx
index 6abae23d6..81eb12d99 100644
--- a/src/AutoComplete.cxx
+++ b/src/AutoComplete.cxx
@@ -117,7 +117,9 @@ void AutoComplete::Move(int delta) {
void AutoComplete::Select(const char *word) {
int pos = lb.Find(word);
//Platform::DebugPrintf("Autocompleting at <%s> %d\n", wordCurrent, pos);
- if (pos != -1)
+ if (pos == -1)
+ Cancel();
+ else
lb.Select(pos);
}