From bac21d8849ee87f51c75e3c6aa8d0260bf51be90 Mon Sep 17 00:00:00 2001 From: Matthew Butterick Date: Wed, 2 Dec 2020 14:58:51 -0800 Subject: [PATCH] Revert "allow false" This reverts commit dfef06c9679d39c2428eb701fb08ede10bd83944. --- beautiful-racket-lib/br/indent.rkt | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/beautiful-racket-lib/br/indent.rkt b/beautiful-racket-lib/br/indent.rkt index fdc377a..a59f820 100644 --- a/beautiful-racket-lib/br/indent.rkt +++ b/beautiful-racket-lib/br/indent.rkt @@ -145,12 +145,11 @@ (check-equal? (line-end-visible t 3) #f)) (define/contract (line-indent text line) - ((is-a?/c text%) (or/c exact-nonnegative-integer? #f) . -> . exact-nonnegative-integer?) + ((is-a?/c text%) (or/c exact-nonnegative-integer? #f) . -> . (or/c exact-nonnegative-integer? #f)) (and (valid-line? text line) - ;; though lsv can be #false (because a line may not have any starting char) - ;; an indent is always, at worst, zero (let ([lsv (line-start-visible text line)]) - (if lsv (- lsv (line-start text line)) 0)))) + (and lsv ; could be #f + (- (line-start-visible text line) (line-start text line)))))) (module+ test (check-equal? (line-indent t 0) 0)