mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 12:28:12 +00:00
LibLine: Do a whole bunch of internal error propagation
This commit is contained in:
parent
f9f1e1dd49
commit
40cb41a16c
8 changed files with 212 additions and 187 deletions
|
@ -182,13 +182,13 @@ SuggestionManager::CompletionAttemptResult SuggestionManager::attempt_completion
|
|||
return result;
|
||||
}
|
||||
|
||||
size_t SuggestionManager::for_each_suggestion(Function<IterationDecision(CompletionSuggestion const&, size_t)> callback) const
|
||||
ErrorOr<size_t> SuggestionManager::for_each_suggestion(Function<ErrorOr<IterationDecision>(CompletionSuggestion const&, size_t)> callback) const
|
||||
{
|
||||
size_t start_index { 0 };
|
||||
for (auto& suggestion : m_suggestions) {
|
||||
if (start_index++ < m_last_displayed_suggestion_index)
|
||||
continue;
|
||||
if (callback(suggestion, start_index - 1) == IterationDecision::Break)
|
||||
if (TRY(callback(suggestion, start_index - 1)) == IterationDecision::Break)
|
||||
break;
|
||||
}
|
||||
return start_index;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue