clojure-mode icon indicating copy to clipboard operation
clojure-mode copied to clipboard

Reader conditional confuses indentation

Open Frozenlock opened this issue 3 years ago • 0 comments

Expected behavior

(reify
  Object    

  #?@(:clj
      [(equals
         [this other])

       (hashCode
         [_]
         (hash 1))]

      :cljs
      [(toJSON
         [this]
         (throw (ex-info "error" {})))

       IEquiv

       (-equiv
         [this other]
         true)]))

Actual behavior


(reify
  Object    

  #?@(:clj
      [(equals
           [this other]) ; <------

       (hashCode
         [_]
         (hash 1))]

      :cljs
      [(toJSON
           [this] ; <------
         (throw (ex-info "error" {})))

       IEquiv

       (-equiv
         [this other]
         true)]))

Steps to reproduce the problem

(setq clojure-indent-style 'align-arguments) (But the problem is the same with 'always-align.)

Paste in a buffer and indent.

(C-x h TAB)

Environment & Version information

clojure-mode version

M-x clojure-mode-display-version

clojure-mode (version nil)

When checking in packages: 20220418.2015

Emacs version

28.1

Operating system

Ubuntu 18.04.6 LTS

Frozenlock avatar May 19 '22 19:05 Frozenlock