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

Incorrect indentation of core.match/match macro #602

Open
darth10 opened this issue Sep 20, 2021 · 0 comments
Open

Incorrect indentation of core.match/match macro #602

darth10 opened this issue Sep 20, 2021 · 0 comments

Comments

@darth10
Copy link

darth10 commented Sep 20, 2021

Expected behavior

clojure-mode should indent match forms (from core.match) the same as M-x cider-format-region or M-x lsp-format-region.

For example:

(doseq [n (range 1 101)]
  (println
   (match [(mod n 3) (mod n 5)]
     [0 0] "FizzBuzz"
     [0 _] "Fizz"
     [_ 0] "Buzz"
     :else n)))

Actual behavior

clojure-mode indents match forms incorrectly.

(doseq [n (range 1 101)]
  (println
   (match [(mod n 3) (mod n 5)]
          [0 0] "FizzBuzz"
          [0 _] "Fizz"
          [_ 0] "Buzz"
          :else n)))

Steps to reproduce the problem

Use the code from the above example in a Clojure(Script) file and run indent-for-tab-command using TAB.

Environment & Version information

clojure-mode version

clojure-mode (version 5.13.0)

Emacs version

27.1

Operating system

macOS 11.5.2 (Big Sur)

Commentary

I'm happy to submit a PR with relevant indentation tests to fix this, but just wanted to make sure it's something that should be added to clojure-mode.

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