Skip to content


Subversion checkout URL

You can clone with
Download ZIP
Browse files

correcting offset error

  • Loading branch information...
commit 93a1987537db72a53040d34eaf6a846c9af05934 1 parent c96dae3
Danny Yoo authored
Showing with 2 additions and 2 deletions.
  1. +2 −2 private/command.rkt
4 private/command.rkt
@@ -117,7 +117,7 @@
;; are eaten in the process.
(define (wrap-to-count str n)
- [(< (string-length str) n) (list str)]
+ [(<= (string-length str) n) (list str)]
[(regexp-match-positions #rx"\n" str 0 n)
(λ (posn)
@@ -125,7 +125,7 @@
(cons (substring str 0 x) (wrap-to-count (substring str y) n))))]
;; iterate backwards from char n looking for a good break
- (let loop ([k (sub1 n)])
+ (let loop ([k n])
[(= k 0) (error wrap-to-count "could not break string")]
[(char=? (string-ref str k) #\space)
Please sign in to comment.
Something went wrong with that request. Please try again.