+ while(true):
+ let userInput = offerSelection()
+
+ case userInput
+ of "all":
+ for selection in selectionRange.begin .. selectionRange.until:
+ # TODO `spawn` this?
+ handleUserInput(selection)
+ of "n":
+ if selectionRange.until + 1 < len(searchResults):
+ selectionRange = (selectionRange.until + 1, min(len(searchResults) - 1, selectionRange.until + limit))
+ continue
+ of "p":
+ if selectionRange.begin > 0:
+ selectionRange = (selectionRange.begin - limit, selectionRange.until - limit)
+ continue
+ of "q":
+ quit(0)