don't forget this case

v6.3-exception
Matthew Butterick 6 years ago
parent 1d2b75456e
commit 3003bc61c3

@ -8,6 +8,9 @@
(define (indent-jsonic tbox [posn 0])
(define prev-line (previous-line tbox posn))
(define current-line (line tbox posn))
(cond
[(not prev-line) 0]
[else
(define prev-indent (line-indent tbox prev-line))
(cond
[(left-bracket?
@ -16,7 +19,7 @@
[(right-bracket?
(line-first-visible-char tbox current-line))
(- prev-indent indent-width)]
[else prev-indent]))
[else prev-indent])]))
(provide
(contract-out
[indent-jsonic (((is-a?/c text%))
@ -28,7 +31,7 @@
(define test-str #<<HERE
#lang jsonic
{
"value",
"value": 42,
"string":
[
{

@ -8,6 +8,9 @@
(define (indent-jsonic tbox [posn 0])
(define prev-line (previous-line tbox posn))
(define current-line (line tbox posn))
(cond
[(not prev-line) 0]
[else
(define prev-indent (line-indent tbox prev-line))
(cond
[(left-bracket?
@ -16,7 +19,7 @@
[(right-bracket?
(line-first-visible-char tbox current-line))
(- prev-indent indent-width)]
[else prev-indent]))
[else prev-indent])]))
(provide
(contract-out
[indent-jsonic (((is-a?/c text%))
@ -28,7 +31,7 @@
(define test-str #<<HERE
#lang jsonic
{
"value",
"value": 42,
"string":
[
{

Loading…
Cancel
Save