1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-26 01:47:34 +00:00

LibLine: Complete only common prefixes, and tweak suggestion logic

On the first tab, only complete the token without suggesting extra
stuff, and on further tabs, show suggestions.
Except in one case where the completion is all in the buffer, then
we show the suggestions, but do no completion.
This commit is contained in:
AnotherTest 2020-04-19 15:55:17 +04:30 committed by Andreas Kling
parent 238afd37cf
commit 7ef48171ce
2 changed files with 88 additions and 14 deletions

View file

@ -196,9 +196,12 @@ private:
String m_new_prompt;
Vector<String> m_suggestions;
String m_last_shown_suggestion;
String m_last_shown_suggestion { String::empty() };
size_t m_last_shown_suggestion_display_length { 0 };
bool m_last_shown_suggestion_was_complete { false };
size_t m_next_suggestion_index { 0 };
size_t m_next_suggestion_invariant_offset { 0 };
size_t m_largest_common_suggestion_prefix_length { 0 };
enum class TabDirection {
Forward,