start indenter
parent
dd67b321d5
commit
4a195ef050
@ -1,12 +1,9 @@
|
|||||||
#lang br
|
#lang br
|
||||||
(require racket/class)
|
(require racket/class describe)
|
||||||
(provide drracket-indenter)
|
(provide drracket-indenter)
|
||||||
|
|
||||||
(define (drracket-indenter t pos)
|
(define (drracket-indenter txt pos)
|
||||||
#;(with-handlers ([exn:fail? (λ(exn) #f)]) ; this function won't work until gui-lib 1.26
|
(define i (char->integer (send txt get-character pos)))
|
||||||
(send t compute-racket-amount-to-indent pos (λ(x)
|
(if (zero? i)
|
||||||
(case x
|
#f
|
||||||
[("with-pattern" "with-shared-id") 'lambda]
|
i))
|
||||||
[("define-macro") 'define]
|
|
||||||
[else #f]))))
|
|
||||||
#f)
|
|
@ -1,7 +1,9 @@
|
|||||||
#lang br/demo/jsonic
|
#lang br/demo/jsonic
|
||||||
{
|
{
|
||||||
"string": @$(string-append "foo" "bar")$@,
|
"string": @$(string-append "foo" "bar")$@,
|
||||||
|
{
|
||||||
"array": @$(range 5)$@,
|
"array": @$(range 5)$@,
|
||||||
"object": @$(hash "k1" "valstring" (format "~a" 42) (hash "k1" (range 10) "k2" 42))$@
|
"object": @$(hash "k1" "valstring" (format "~a" 42) (hash "k1" (range 10) "k2" 42))$@
|
||||||
|
}
|
||||||
// "bar" :
|
// "bar" :
|
||||||
}
|
}
|
Loading…
Reference in New Issue