Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

cril (introduce let) does not properly indent the body of the new let form #21

Open
daveyarwood opened this issue May 18, 2018 · 0 comments

Comments

@daveyarwood
Copy link

daveyarwood commented May 18, 2018

For example, I have this top-level form:

(defrpc campaigns
  [& [opts]]
  {:rpc/pre (and (have-api-key) (have-network))}
  (->> (view/campaigns (network) opts)
       (map #(safe-parse-json % :customfields))))

When I put my cursor on the ( before ->> and enter cril and enter cs for the binding name, the result is:

(defrpc campaigns
  [& [opts]]
  {:rpc/pre (and (have-api-key) (have-network))}
  (let [cs (->> (view/campaigns (network) opts))]
       (map #(safe-parse-json % :customfields))))
cs

I use parinfer, so it re-balanced my parens because cs was all the way to the left, so it was judged to be another top-level form. The bindings part of the let also got closed prematurely because the line after it wasn't indented far enough to the right.

If I disable parinfer and do the same thing, I get this, which is still not indented properly:

(defrpc campaigns
  [& [opts]]
  {:rpc/pre (and (have-api-key) (have-network))}
  (let [cs (->> (view/campaigns (network) opts)
       (map #(safe-parse-json % :customfields)))]
cs))

Note that not only is cs not indented at all, the previous line also has incorrect indentation now because it didn't move from where it was before.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant