Skip to content

Commit 4dcf6b7

Browse files
anthonygaleabbatsov
authored andcommitted
[Fix #511] Fix incorrect indentation of namespaced map (#533)
1 parent 9c82c78 commit 4dcf6b7

File tree

2 files changed

+27
-1
lines changed

2 files changed

+27
-1
lines changed

clojure-mode-indentation-test.el

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -148,6 +148,24 @@ DESCRIPTION is a string with the description of the spec."
148148
(cond
149149
|x)")
150150

151+
(when-indenting-with-point-it "should indent cond-> with a namespaced map"
152+
"
153+
(cond-> #:a{:b 1}
154+
|x 1)"
155+
156+
"
157+
(cond-> #:a{:b 1}
158+
|x 1)")
159+
160+
(when-indenting-with-point-it "should indent cond-> with a namespaced map 2"
161+
"
162+
(cond-> #::a{:b 1}
163+
|x 1)"
164+
165+
"
166+
(cond-> #::a{:b 1}
167+
|x 1)")
168+
151169
(when-indenting-with-point-it "should indent threading macro with expression on first line"
152170
"
153171
(->> expr

clojure-mode-sexp-test.el

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -117,7 +117,15 @@ and point left there."
117117
(clojure-forward-logical-sexp 2)
118118
(expect (looking-back "\\^String biverse"))
119119
(clojure-backward-logical-sexp 1)
120-
(expect (looking-at-p "\\^String biverse")))))
120+
(expect (looking-at-p "\\^String biverse"))))
121+
122+
(it "should handle a namespaced map"
123+
(with-clojure-buffer "first #:name/space{:k v}"
124+
(clojure-backward-logical-sexp 1)
125+
(expect (looking-at-p "#:name/space{:k v}"))
126+
(insert " #::ns {:k v}")
127+
(clojure-backward-logical-sexp 1)
128+
(expect (looking-at-p "#::ns {:k v}")))))
121129

122130
(describe "clojure-backward-logical-sexp"
123131
(it "should work with buffer corners"

0 commit comments

Comments
 (0)