LibLine: Autocomplete single suggestions

`cd /h<tab>` -> `cd /home/`, pressing tab after that would
descend into `/home/' and show `/home/anon/`
This commit is contained in:
AnotherTest 2020-04-12 22:24:21 +04:30 committed by Andreas Kling
parent d3e735f279
commit fa0525b8bf
Notes: sideshowbarker 2024-07-19 07:39:38 +09:00

View File

@ -382,7 +382,15 @@ String Editor::get_line(const String& prompt)
}
reposition_cursor();
}
if (m_suggestions.size() < 2) {
// we have none, or just one suggestion
// we should just commit that and continue
// after it, as if it were auto-completed
suggest(0, 0);
m_last_shown_suggestion = String::empty();
m_suggestions.clear();
m_times_tab_pressed = 0;
}
continue;
}