Fork me on GitHub
#vim
<
2016-10-16
>
dominicm09:10:05

https://github.com/kkinnear/zprint/blob/master/README.md I wonder how this would look with rewrite cljs... :D

dominicm13:10:58

Does anybody else get whitespace at the ends of lines when using clj refactor.nvim?

dominicm17:10:37

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>

dominicm17:10:54

Not sure why \n = <SPC>\n that's the real issue

dominicm18:10:36

(-> (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)"

dominicm18:10:48

My custom version of the functions in that namespace work

dominicm18:10:14

Looks like rewrite-clj has a smarter patch which might deal with this in some way.

dominicm18:10:11

Nope, okay. I'm just gonna write a patch for nvim-refactor using a non-space-inserting version

dominicm19:10:59

Buuut no append-child. Given the simplicity of the function, I'm just going to inline it where used.

dominicm19:10:12

@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