Skip to content

Commit

Permalink
Fix multi-airty indention of deftype & defrecord (clojure-emacs#389)
Browse files Browse the repository at this point in the history
  • Loading branch information
bpoweski committed Jun 26, 2016
1 parent 6d0dea4 commit 16b507d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 2 deletions.
4 changes: 2 additions & 2 deletions clojure-mode.el
Original file line number Diff line number Diff line change
Expand Up @@ -1313,8 +1313,8 @@ work). To set it from Lisp code, use
(as-> 2)

(reify '(:defn (1)))
(deftype '(2 nil nil (1)))
(defrecord '(2 nil nil (1)))
(deftype '(2 nil nil (:defn)))
(defrecord '(2 nil nil (:defn)))
(defprotocol '(1 (:defn)))
(extend 1)
(extend-protocol '(1 :defn))
Expand Down
18 changes: 18 additions & 0 deletions test/clojure-mode-indentation-test.el
Original file line number Diff line number Diff line change
Expand Up @@ -280,6 +280,15 @@ values of customisable variables."
([item a]
(* a (:qty item)))))")

(def-full-indent-test deftype-allow-multiarity
"(deftype Banana []
Fruit
(subtotal
([item]
(* 158 (:qty item)))
([item a]
(* a (:qty item)))))")

(def-full-indent-test defprotocol
"(defprotocol IFoo
(foo [this]
Expand Down Expand Up @@ -326,6 +335,15 @@ values of customisable variables."
SomeType (assoc [_ x]
(.assoc pretty x 10)))")

(def-full-indent-test defrecord-allow-multiarity
"(defrecord Banana []
Fruit
(subtotal
([item]
(* 158 (:qty item)))
([item a]
(* a (:qty item)))))")

(def-full-indent-test letfn
"(letfn [(f [x]
(* x 2))
Expand Down

0 comments on commit 16b507d

Please sign in to comment.