diff options
author | AnotherTest <ali.mpfard@gmail.com> | 2020-05-12 03:29:59 +0430 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2020-05-12 08:57:14 +0200 |
commit | b64bb7a3e1fd38aa9659c0863e17d1c010e9e140 (patch) | |
tree | 4feca77a5c0e3a8ff329850a7c016675a6f47ad6 | |
parent | ae3353bdbc4da3a0ad46cf573aa4bb74ccbea834 (diff) | |
download | serenity-b64bb7a3e1fd38aa9659c0863e17d1c010e9e140.zip |
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
```
-rw-r--r-- | Libraries/LibLine/Editor.cpp | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Libraries/LibLine/Editor.cpp b/Libraries/LibLine/Editor.cpp index 3542511996..a38fb2d5f0 100644 --- a/Libraries/LibLine/Editor.cpp +++ b/Libraries/LibLine/Editor.cpp @@ -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()); } |