pagination: "p" takes to the previous page of results
authorJoseph Nuthalapati <njoseph@riseup.net>
Fri, 17 Apr 2020 14:34:04 +0000 (20:04 +0530)
committerJoseph Nuthalapati <njoseph@riseup.net>
Fri, 17 Apr 2020 14:34:04 +0000 (20:04 +0530)
Signed-off-by: Joseph Nuthalapati <njoseph@riseup.net>
src/nimcoon.nim

index 5ddcfcc78575cd7bd0e75ce9b41d1fb6ae1d62a4..81db7327645d3cf2711d363436f8974e8413e49a 100644 (file)
@@ -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)