zprint icon indicating copy to clipboard operation
zprint copied to clipboard

Namespace map context (`#:` syntax) is deleted when zprint style is `indent-only`

Open tflavin opened this issue 2 years ago • 4 comments

zprint is deleting the namespace map context specified by the #: syntax when the style is indent-only.

(zp/zprint-file-str "#:a{:b 1}" "example")
=> "#:a{:b 1}"

(zp/zprint-file-str "#:a{:b 1}" "example" {:style [:indent-only]})
=> "{:b 1}"

tflavin avatar Jun 09 '22 19:06 tflavin

Thanks for the issue. That's really not good. That said, I'm interested that anyone actually uses :indent-only! It was a lot of work, so it is nice to know someone cares. I'll work on this and make sure it gets fixed soon. Namespaced maps have been a challenge all along the way, from parsing to handling them in .clj and .cljs. More later as I figure this out.

kkinnear avatar Jun 09 '22 19:06 kkinnear

I have fixed this, and it will be available in the next release, almost certainly called 1.2.4. It will be at least two weeks at the earliest before I can test and release a new version of zprint. I hope that this problem won't cause you too much pain in the interim. I was working on a large capability and expected to be a while before I packaged up the next release, but based partly on this problem, I'll move up my release schedule to get this fixed sooner than I had otherwise planned to release it.

Thank you again for noticing and submitting this issue!

kkinnear avatar Jun 09 '22 21:06 kkinnear

No problem. I was just evaluating it against my codebase, so it's not hurting me as of now. I believe I noticed one other thing and will open a separate issue for that.

tflavin avatar Jun 10 '22 13:06 tflavin

Fixed in 1.2.4. Thanks for noticing this! (and the other one too!).

kkinnear avatar Aug 02 '22 16:08 kkinnear