Skip to content

Commit 0388414

Browse files
committed
Fix indentation of with-* macros
1 parent 4edeef0 commit 0388414

File tree

5 files changed

+50
-20
lines changed

5 files changed

+50
-20
lines changed
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(with-open [f (io/file)]
2+
(slurp f))
3+
4+
(with-meta obj
5+
{:foo 1})
6+
7+
(with-meta
8+
obj
9+
{:foo 1})
10+
11+
(with-out-str
12+
())
13+
14+
(with-in-str
15+
())
Lines changed: 15 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,15 @@
1+
(with-open [f (io/file)]
2+
(slurp f))
3+
4+
(with-meta obj
5+
{:foo 1})
6+
7+
(with-meta
8+
obj
9+
{:foo 1})
10+
11+
(with-out-str
12+
())
13+
14+
(with-in-str
15+
())

indent/clojure.vim

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -26,32 +26,32 @@ setlocal indentkeys=!,o,O
2626

2727
if !exists('g:clojure_fuzzy_indent_patterns')
2828
let g:clojure_fuzzy_indent_patterns = [
29-
\ "\v^with-%(meta|out-str|loading-context)\@!",
30-
\ "^def",
31-
\ "^let"
29+
\ '^with-\%(meta\|out-str\|loading-context\)\@!',
30+
\ '^def',
31+
\ '^let'
3232
\ ]
3333
endif
3434

3535
if !exists('g:clojure_indent_rules')
3636
" Defaults copied from: https://github.com/clojure-emacs/clojure-mode/blob/0e62583b5198f71856e4d7b80e1099789d47f2ed/clojure-mode.el#L1800-L1875
3737
let g:clojure_indent_rules = {
38-
\ "ns": 1,
39-
\ "fn": 1, "def": 1, "defn": 1, "bound-fn": 1,
40-
\ "if": 1, "if-not": 1, "if-some": 1, "if-let": 1,
41-
\ "when": 1, "when-not": 1, "when-some": 1, "when-let": 1, "when-first": 1,
42-
\ "case": 1, "cond": 0, "cond->": 1, "cond->>": 1, "condp": 2,
43-
\ "while": 1, "loop": 1, "for": 1, "doseq": 1, "dotimes": 1,
44-
\ "do": 0, "doto": 1, "comment": 0, "as->": 2,
45-
\ "delay": 0, "future": 0, "locking": 1,
46-
\ "fdef": 1,
47-
\ "extend": 1,
48-
\ "try": 0, "catch": 2, "finally": 0,
49-
\ "let": 1, "binding": 1,
50-
\ "defmethod": 1,
51-
\ "this-as": 1,
52-
\ "deftest": 1, "testing": 1, "use-fixtures": 1, "are": 2,
53-
\ "alt!": 0, "alt!!": 0, "go": 0, "go-loop": 1, "thread": 0,
54-
\ "run": 1, "run*": 1, "fresh": 1
38+
\ 'ns': 1,
39+
\ 'fn': 1, 'def': 1, 'defn': 1, 'bound-fn': 1,
40+
\ 'if': 1, 'if-not': 1, 'if-some': 1, 'if-let': 1,
41+
\ 'when': 1, 'when-not': 1, 'when-some': 1, 'when-let': 1, 'when-first': 1,
42+
\ 'case': 1, 'cond': 0, 'cond->': 1, 'cond->>': 1, 'condp': 2,
43+
\ 'while': 1, 'loop': 1, 'for': 1, 'doseq': 1, 'dotimes': 1,
44+
\ 'do': 0, 'doto': 1, 'comment': 0, 'as->': 2,
45+
\ 'delay': 0, 'future': 0, 'locking': 1,
46+
\ 'fdef': 1,
47+
\ 'extend': 1,
48+
\ 'try': 0, 'catch': 2, 'finally': 0,
49+
\ 'let': 1, 'binding': 1,
50+
\ 'defmethod': 1,
51+
\ 'this-as': 1,
52+
\ 'deftest': 1, 'testing': 1, 'use-fixtures': 1, 'are': 2,
53+
\ 'alt!': 0, 'alt!!': 0, 'go': 0, 'go-loop': 1, 'thread': 0,
54+
\ 'run': 1, 'run*': 1, 'fresh': 1
5555
\ }
5656

5757
" (letfn '(1 ((:defn)) nil))

0 commit comments

Comments
 (0)