1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-05-19 00:35:06 +00:00

LibLine: Fix suggestion spacing regression

This patch fixes an issue where the line editor would put no spacing
between suggestions (only when there are two suggestions).
To reproduce, try on a build with no ports (starting with `pro`):
```
> pro<tab>
profilepro
```
This commit is contained in:
AnotherTest 2020-05-12 03:29:59 +04:30 committed by Andreas Kling
parent ae3353bdbc
commit b64bb7a3e1

View file

@ -506,7 +506,7 @@ String Editor::get_line(const String& prompt)
size_t start_index = 0;
for (auto& suggestion : m_suggestions) {
if (start_index++ <= m_last_displayed_suggestion_index)
if (start_index++ < m_last_displayed_suggestion_index)
continue;
longest_suggestion_length = max(longest_suggestion_length, suggestion.text.length());
}