@@ -248,6 +248,8 @@ function! s:ListIndent(delim_pos)
248
248
let base_indent = s: PosToCharPos (a: delim_pos )[1 ]
249
249
let ln = getline(a:delim_pos[0])
250
250
251
+ let sym_match = -1
252
+
251
253
" 1. Macro/rule indentation
252
254
" if starts with a symbol, extract it.
253
255
" - Split namespace off symbol and #'/' syntax.
@@ -265,7 +267,6 @@ function! s:ListIndent(delim_pos)
265
267
266
268
if ! empty (syms)
267
269
let sym = syms[0 ]
268
- " TODO: if prefixed with "#'" or "'" fallback to func indent.
269
270
if sym = ~# ' \v^%([a-zA-Z!$&*_+=|<>?-]|[^\x00-\x7F])'
270
271
271
272
" TODO: handle namespaced and non-namespaced variants.
@@ -281,7 +282,7 @@ function! s:ListIndent(delim_pos)
281
282
let rules = s: Conf (' clojure_indent_rules' , {})
282
283
let sym_match = get (rules, sym, -1 )
283
284
" TODO: handle 2+ differently?
284
- if sym_match >= 0 | return base_indent + 1 | endif
285
+ if sym_match > 0 | return base_indent + 1 | endif
285
286
endif
286
287
endif
287
288
@@ -298,7 +299,9 @@ function! s:ListIndent(delim_pos)
298
299
299
300
" Fallback indentation for operands. When "clojure_indent_style" is
300
301
" "always-align", use 1 space indentation, else 2 space indentation.
301
- return base_indent + (indent_style !=# ' always-align' )
302
+ " The "sym_match" check handles the case when "clojure_indent_rules"
303
+ " specified a value of "0".
304
+ return base_indent + (indent_style !=# ' always-align' || sym_match == 0 )
302
305
endfunction
303
306
304
307
function ! s: ClojureIndent ()
0 commit comments