|
|
|
@ -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
|
|
|
|
|