From 32f915a844db82d52d832004f2901bd704ad026c Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 20 Jun 2018 16:52:01 -0700 Subject: [PATCH] return #f for line with no indent --- beautiful-racket-lib/br/indent.rkt | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/beautiful-racket-lib/br/indent.rkt b/beautiful-racket-lib/br/indent.rkt index 690af84..d9af8e3 100644 --- a/beautiful-racket-lib/br/indent.rkt +++ b/beautiful-racket-lib/br/indent.rkt @@ -149,10 +149,11 @@ (and (valid-line? text line) (let ([lsv (line-start-visible text line)]) (and lsv ; could be #f - (- (line-start-visible text line) (line-start text line)))))) + (let ([li (- (line-start-visible text line) (line-start text line))]) + (and (positive? li) li)))))) (module+ test - (check-equal? (line-indent t 0) 0) + (check-equal? (line-indent t 0) #f) (check-equal? (line-indent t 1) 1) (check-equal? (line-indent t 2) 2) (check-equal? (line-indent t 3) #f))