clojure-vim/clj-refactor.nvim

The last call to thread-unwind undoes surrounding indentation

daveyarwood opened this issue · 0 comments

Given a form like this:

(deftest example-tests
  (testing "something"
    (is (= 1 1))
    (-> foo bar baz)
    (is (= 2 2))))

If I put my cursor on the ( to the left of the -> and do cruw (thread-unwind), I get this, which is good:

(deftest example-tests
  (testing "something"
    (is (= 1 1))
    (-> (bar foo) baz)
    (is (= 2 2))))

But when I unwind the last level of threading by running cruw again, I get this, which is not indented properly:

(deftest example-tests
  (testing "something"
  (is (= 1 1))
  (baz (bar foo))
  (is (= 2 2))))

I get the same result if I start with the (-> foo bar baz) version at the top of this post and I do crua (unwind-all):

(deftest example-tests
  (testing "something"
  (is (= 1 1))
  (baz (bar foo))
  (is (= 2 2))))