diff options
Diffstat (limited to 'Userland/Libraries/LibLine')
-rw-r--r-- | Userland/Libraries/LibLine/SuggestionManager.cpp | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/Userland/Libraries/LibLine/SuggestionManager.cpp b/Userland/Libraries/LibLine/SuggestionManager.cpp index 80cf37b457..d569de39a5 100644 --- a/Userland/Libraries/LibLine/SuggestionManager.cpp +++ b/Userland/Libraries/LibLine/SuggestionManager.cpp @@ -31,9 +31,12 @@ void SuggestionManager::set_suggestions(Vector<CompletionSuggestion>&& suggestio { m_suggestions = move(suggestions); - // make sure we were not given invalid suggestions - for (auto& suggestion : m_suggestions) + // Set the views and make sure we were not given invalid suggestions + for (auto& suggestion : m_suggestions) { VERIFY(suggestion.is_valid); + suggestion.text_view = { suggestion.text.data(), suggestion.text.size() }; + suggestion.trivia_view = { suggestion.trailing_trivia.data(), suggestion.trailing_trivia.size() }; + } size_t common_suggestion_prefix { 0 }; if (m_suggestions.size() == 1) { |