Skip to content

Commit f01e8f8

Browse files
authored
Set indent-with-indicator before indicator-indent in dumper options (#142)
1 parent ca228f2 commit f01e8f8

File tree

2 files changed

+16
-3
lines changed

2 files changed

+16
-3
lines changed

src/clojure/clj_yaml/core.clj

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -72,10 +72,10 @@
7272
(.setDefaultFlowStyle dumper (flow-styles flow-style)))
7373
(when indent
7474
(.setIndent dumper indent))
75-
(when indicator-indent
76-
(.setIndicatorIndent dumper indicator-indent))
7775
(when indent-with-indicator
7876
(.setIndentWithIndicator dumper indent-with-indicator))
77+
(when indicator-indent
78+
(.setIndicatorIndent dumper indicator-indent))
7979
dumper))
8080

8181
(defn default-loader-options

test/clj_yaml/core_test.clj

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -411,7 +411,20 @@ lol: yolo")
411411
:dumper-options {:indent 5
412412
:indicator-indent 2
413413
:indent-with-indicator true
414-
:flow-style :block})))))
414+
:flow-style :block})))
415+
(is (= (str "todo:\n"
416+
;12
417+
" issues:\n"
418+
;; 12
419+
" - name: Fix all the things\n"
420+
" responsible:\n"
421+
;; 12
422+
" name: Rita\n")
423+
(generate-string (parse-string indent-yaml)
424+
:dumper-options {:indent 2
425+
:indicator-indent 2
426+
:indent-with-indicator true
427+
:flow-style :block})))))
415428

416429
(def yaml-with-unknown-tags "---
417430
scalar: !CustomScalar some-scalar

0 commit comments

Comments
 (0)