1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-31 14:48:14 +00:00

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

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