mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 19:38:12 +00:00
LibLine: Make sure suggestions have their *_views set correctly
This commit is contained in:
parent
a76730823a
commit
941550e601
1 changed files with 5 additions and 2 deletions
|
@ -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) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue