1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-06-01 11:18:13 +00:00

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).
This commit is contained in:
Ali Mohammad Pur 2021-07-19 23:10:18 +04:30 committed by Ali Mohammad Pur
parent 54bf6a7884
commit 0f6654fef2

View file

@ -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());