From b64bb7a3e1fd38aa9659c0863e17d1c010e9e140 Mon Sep 17 00:00:00 2001 From: AnotherTest Date: Tue, 12 May 2020 03:29:59 +0430 Subject: [PATCH] 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 profilepro ``` --- Libraries/LibLine/Editor.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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()); }