Skip to content

Commit 8912024

Browse files
author
Yannick Scherer
committed
[#57] merge metadata when converting to s-expression instead of replacing it.
Closes #57.
1 parent c5c94f0 commit 8912024

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

src/rewrite_clj/node/meta.clj

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@
1313
(let [[mta data] (node/sexprs children)]
1414
(assert (instance? clojure.lang.IMeta data)
1515
(str "cannot attach metadata to: " (pr-str data)))
16-
(with-meta data (if (map? mta) mta {mta true}))))
16+
(vary-meta data merge (if (map? mta) mta {mta true}))))
1717
(length [_]
1818
(+ (count prefix) (node/sum-lengths children)))
1919
(string [_]

0 commit comments

Comments
 (0)