parinfer / parinfer.js

Let's simplify the way we write Lisp
https://shaunlebron.github.io/parinfer
MIT License
1.75k stars 40 forks source link

Namespaced map indentation doesn't agree with cljfmt #191

Closed elzibubble closed 5 years ago

elzibubble commented 5 years ago

parinfer-rust seems to want:

(defn foo
  [bar]
  #::zod
  {:quux {}

whereas cljfmt seems to prefer:

(defn foo
  [bar]
  #::zod
   {:quux {}

Note the extra space before {:quux.

For context: Our CI fails if the formatting doesn't agree with cljfmt. Therefore I have cljfmt set up to run on save, causing the indentation to waver between the two, causing my buffer modified flag to usually be set. This is particularly annoying when I try to run git multidiff as it causes an error, preventing the 'new text' pane from opening.

elzibubble commented 5 years ago

Raised https://github.com/eraserhd/parinfer-rust/issues/32 and got redirected here

shaunlebron commented 5 years ago

interesting, this should be allowed, but i'll look into why it's not

shaunlebron commented 5 years ago

yup, can't believe this bug has been in here for 3 years. thanks for the report 👍

i added some test cases. gonna think about how best to fix

shaunlebron commented 5 years ago

oops—i found a section of the documentation describing why this is intended: https://github.com/shaunlebron/parinfer/blob/master/lib/test/cases/paren-mode.md#extending-indentation-constraints

elzibubble commented 5 years ago

Welp this is pretty annoying but I can't think of a solution so let's close the issue already.