Don't use suggestions if object searched is not found

Closes: #604
do-not-use-first-sujection
Hleb Valoshka 2022-01-20 18:45:39 +02:00
parent f969b37c3e
commit 6a3f93a295
1 changed files with 2 additions and 0 deletions

View File

@ -1045,10 +1045,12 @@ void CelestiaCore::charEntered(const char *c_p, int modifiers)
if (typedText != "")
{
Selection sel = sim->findObjectFromPath(typedText, true);
#ifdef AUTO_COMPLETION
if (sel.empty() && typedTextCompletion.size() > 0)
{
sel = sim->findObjectFromPath(typedTextCompletion[0], true);
}
#endif
if (!sel.empty())
{
addToHistory();