summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAnotherTest <ali.mpfard@gmail.com>2020-05-12 03:29:59 +0430
committerAndreas Kling <kling@serenityos.org>2020-05-12 08:57:14 +0200
commitb64bb7a3e1fd38aa9659c0863e17d1c010e9e140 (patch)
tree4feca77a5c0e3a8ff329850a7c016675a6f47ad6
parentae3353bdbc4da3a0ad46cf573aa4bb74ccbea834 (diff)
downloadserenity-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.cpp2
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());
}