Fixed a little bug that stopped you from removing item 1

cleanup
m455 2020-06-15 15:29:15 -04:00
parent c1da55989b
commit 4c491e41c8
1 changed files with 5 additions and 1 deletions

View File

@ -159,7 +159,11 @@
[list-length (length listof-nicethings)]) [list-length (length listof-nicethings)])
(if (and (not (null? listof-nicethings)) (if (and (not (null? listof-nicethings))
(number? item-number) (number? item-number)
(positive? item-number) ;; zero is okay in an index, but the user is never
;; presented with a 0 option, so, if the user types
;; `nicethings rm 1` add back the 1 that was
;; subtracted above
(positive? (add1 item-number))
;; less than length, because the index ;; less than length, because the index
;; starts at 0 under the hood ;; starts at 0 under the hood
(< item-number list-length)) (< item-number list-length))