diff options
author | Ali Mohammad Pur <ali.mpfard@gmail.com> | 2021-07-19 23:10:18 +0430 |
---|---|---|
committer | Ali Mohammad Pur <Ali.mpfard@gmail.com> | 2021-07-20 11:55:42 +0430 |
commit | 0f6654fef289421bafaacbae1aa5c04bf8292bd8 (patch) | |
tree | c69a9b4b57d62d6cee43e8e3e9221f1d9cade282 /Userland/Libraries | |
parent | 54bf6a7884f0c4a589e0b4d6f1ca96645b77fa5b (diff) | |
download | serenity-0f6654fef289421bafaacbae1aa5c04bf8292bd8.zip |
LibLine: Reset the suggestion page offset when finding the max length
Otherwise, something like shift+tab->tab->tab will mess up the page
contents (assuming that the max lengths in the pages are different).
Diffstat (limited to 'Userland/Libraries')
-rw-r--r-- | Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp b/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp index 882b63f9ba..a691bba5df 100644 --- a/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp +++ b/Userland/Libraries/LibLine/XtermSuggestionDisplay.cpp @@ -20,6 +20,7 @@ void XtermSuggestionDisplay::display(const SuggestionManager& manager) size_t longest_suggestion_length = 0; size_t longest_suggestion_byte_length = 0; + manager.set_start_index(0); manager.for_each_suggestion([&](auto& suggestion, auto) { longest_suggestion_length = max(longest_suggestion_length, suggestion.text_view.length()); longest_suggestion_byte_length = max(longest_suggestion_byte_length, suggestion.text_string.length()); |