diff --git a/beautiful-racket-lib/br/main.rkt b/beautiful-racket-lib/br/main.rkt index 23fc833..ecd864d 100644 --- a/beautiful-racket-lib/br/main.rkt +++ b/beautiful-racket-lib/br/main.rkt @@ -28,20 +28,11 @@ (require racket/class) (define (indenter t pos) - (define reserved-terms (map string->list '("with-pattern" "with-shared-id" "define-macro"))) - - (define sexp-start-pos (send t find-up-sexp pos)) - (define paren-length 1) - (define sexp-name-start (send t skip-whitespace (+ paren-length (or sexp-start-pos 0)) 'forward #t)) - (define sexp-name (for*/list ([p (in-naturals sexp-name-start)] - [c (in-value (send t get-character p))] - #:break (char-whitespace? c)) - c)) - (and (member sexp-name reserved-terms) - (let* ([paranum (send t position-paragraph sexp-name-start)] - [psp (send t paragraph-start-position paranum)] - [prev-indent (- sexp-name-start psp)]) - (add1 prev-indent)))) ; #f will trigger default indentation + (send t compute-racket-amount-to-indent pos (λ(x) + (case x + [("with-pattern" "with-shared-id") 'lambda] + [("define-macro") 'define] + [else #f])))) (define (my-get-info key default default-filter) (case key diff --git a/beautiful-racket-lib/info.rkt b/beautiful-racket-lib/info.rkt index 3086d63..c6a6300 100644 --- a/beautiful-racket-lib/info.rkt +++ b/beautiful-racket-lib/info.rkt @@ -2,5 +2,7 @@ (define collection 'multi) (define version "0.01") -(define deps '("base" "sugar")) +(define deps '("base" + "sugar" + ["gui-lib" #:version "1.26"])) ; for indenter fix (define build-deps '("racket-doc" "rackunit-lib" "scribble-lib"))