This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2016-10-16
Channels
- # beginners (1)
- # boot (69)
- # carry (1)
- # cider (29)
- # cljs-dev (17)
- # cljsrn (100)
- # clojure (13)
- # clojure-austin (13)
- # clojure-brasil (1)
- # clojure-dev (1)
- # clojure-korea (3)
- # clojure-russia (3)
- # clojure-spec (20)
- # clojure-uk (5)
- # clojurescript (45)
- # cloverage (3)
- # datomic (5)
- # figwheel (1)
- # hoplon (198)
- # klipse (25)
- # lein-figwheel (2)
- # leiningen (3)
- # off-topic (35)
- # om (7)
- # om-next (2)
- # onyx (8)
- # proton (8)
- # re-frame (3)
- # untangled (1)
- # vim (13)
https://github.com/kkinnear/zprint/blob/master/README.md I wonder how this would look with rewrite cljs... :D
Seems that every newline that's inserted, adds a space after it. Updating cljfmt helps a little because the new version removes the spaces, and cljfmt is run on the inner form, example:
(def foo<SPC>
body)<SPC>
becomes
(def foo
body)<SPC>
(-> (z/of-string "(defn foo [whyohwhy] body)")
(z/rightmost)
(z/insert-left (n/newline-node "\n\n"))
z/root-string) ;; "\n\n (defn foo [whyohwhy] body)"
https://github.com/rundis/rewrite-cljs/blob/master/src/rewrite_clj/zip/insert.cljs#L30-L37
Nope, okay. I'm just gonna write a patch for nvim-refactor using a non-space-inserting version
https://github.com/xsc/rewrite-clj/blob/master/src/rewrite_clj/zip/whitespace.clj#L63-L68 Apparently a solved problem 😄
Buuut no append-child. Given the simplicity of the function, I'm just going to inline it where used.
@zamaterian https://github.com/clojure-vim/clj-refactor.nvim/pull/10 fixed! Like I mentioned in the PR, I probably missed many of them, but hopefully this shows how easy it is to fix them. If you find yourself with another and get stuck fixing it, send me a message and I'll try to help