浏览代码

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
```
AnotherTest 5 年之前
父节点
当前提交
b64bb7a3e1
共有 1 个文件被更改,包括 1 次插入1 次删除
  1. 1 1
      Libraries/LibLine/Editor.cpp

+ 1 - 1
Libraries/LibLine/Editor.cpp

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