@@ -248,6 +248,8 @@ function! s:ListIndent(delim_pos)
248248 let base_indent = s: PosToCharPos (a: delim_pos )[1 ]
249249 let ln = getline(a:delim_pos[0])
250250
251+ let sym_match = -1
252+
251253 " 1. Macro/rule indentation
252254 " if starts with a symbol, extract it.
253255 " - Split namespace off symbol and #'/' syntax.
@@ -265,7 +267,6 @@ function! s:ListIndent(delim_pos)
265267
266268 if ! empty (syms)
267269 let sym = syms[0 ]
268- " TODO: if prefixed with "#'" or "'" fallback to func indent.
269270 if sym = ~# ' \v^%([a-zA-Z!$&*_+=|<>?-]|[^\x00-\x7F])'
270271
271272 " TODO: handle namespaced and non-namespaced variants.
@@ -281,7 +282,7 @@ function! s:ListIndent(delim_pos)
281282 let rules = s: Conf (' clojure_indent_rules' , {})
282283 let sym_match = get (rules, sym, -1 )
283284 " TODO: handle 2+ differently?
284- if sym_match >= 0 | return base_indent + 1 | endif
285+ if sym_match > 0 | return base_indent + 1 | endif
285286 endif
286287 endif
287288
@@ -298,7 +299,9 @@ function! s:ListIndent(delim_pos)
298299
299300 " Fallback indentation for operands. When "clojure_indent_style" is
300301 " "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 )
302305endfunction
303306
304307function ! s: ClojureIndent ()
0 commit comments