From: Joseph Nuthalapati Date: Fri, 17 Apr 2020 14:34:04 +0000 (+0530) Subject: pagination: "p" takes to the previous page of results X-Git-Tag: 0.2.0~2 X-Git-Url: https://njoseph.me/gitweb/nimcoon.git/commitdiff_plain/4918a147760087de4d1d4dc5e8d5a26cc573f91a pagination: "p" takes to the previous page of results Signed-off-by: Joseph Nuthalapati --- diff --git a/src/nimcoon.nim b/src/nimcoon.nim index 5ddcfcc..81db732 100644 --- a/src/nimcoon.nim +++ b/src/nimcoon.nim @@ -96,7 +96,10 @@ proc main() = if selectionRange.until + 1 < len(searchResults): selectionRange = (selectionRange.until + 1, min(len(searchResults) - 1, selectionRange.until + limit)) continue - # of "p": + of "p": + if selectionRange.begin > 0: + selectionRange = (selectionRange.begin - limit, selectionRange.until - limit) + continue of "q": quit(0)