Fixed|Console|UI: Crash when using autocompletion

The logic for reshowing the completion popup was incomplete.

This commit fixes #1645.