@@ -22,6 +22,9 @@ setlocal noautoindent nosmartindent nolisp
2222setlocal softtabstop = 2 shiftwidth = 2 expandtab
2323setlocal indentkeys = ! ,o ,O
2424
25+ " FIXME: fix reader conditional tests. Include (:require [...]) test cases.
26+ " Is it possible to fix reader conditional indentation?
27+
2528" Set a new configuration option with a default value. Assigns a script-local
2629" version too, to be used as a default fallback if the global was "unlet".
2730function ! s: SConf (name, default) abort
@@ -37,19 +40,12 @@ endfunction
3740
3841call s: SConf (' clojure_indent_style' , ' standard' )
3942call s: SConf (' clojure_indent_multiline_strings' , ' standard' )
40-
41- " TODO: rename this option.
4243call s: SConf (' clojure_fuzzy_indent_patterns' , [
4344\ ' ^with-\%(meta\|in-str\|out-str\|loading-context\)\@!' ,
4445\ ' ^def' ,
4546\ ' ^let'
4647\ ])
4748
48- " FIXME: fix reader conditional tests. Include (:require [...]) test cases.
49- " Is it possible to fix reader conditional indentation?
50-
51- " TODO: make the indentation function usable from other Clojure-like languages.
52-
5349" TODO: explain the different numbers. The "indent_style" option can override "0"
5450" - -1 Not in dictionary, follow defaults.
5551" - 0: Align to first argument, else 2 space indentation.
@@ -93,8 +89,7 @@ endfunction
9389" Used during list function indentation. Returns the position of the first
9490" operand in the list on the first line of the form at "pos".
9591function ! s: FirstFnArgPos (pos)
96- " TODO: ignore comments.
97- " TODO: handle escaped characters!
92+ " TODO: ignore comments and handle escaped characters!
9893 let lnr = a: pos [0 ]
9994 let s: in_form_current_form = a: pos
10095 call cursor (lnr , a: pos [1 ] + 1 )
@@ -234,9 +229,6 @@ function! s:StringIndent(delim_pos)
234229 if m == # ' i' || (m == # ' n' && ! s: EqualsOperatorInEffect ())
235230 " If in insert mode, or normal mode but "=" is not in effect.
236231 let alignment = s: Conf (' clojure_indent_multiline_strings' , s: clojure_indent_multiline_strings )
237- " standard: Indent in alignment with end of the string start delimiter.
238- " traditional: Indent along left edge, like traditional Lisps.
239- " pretty: Indent in alignment with string start delimiter.
240232 if alignment == # ' traditional' | return 0
241233 elseif alignment == # ' pretty' | return s: PosToCharCol (a: delim_pos )
242234 else " standard
@@ -288,7 +280,7 @@ function! s:ListIndent(delim_pos)
288280 let [_namespace, name] = split (sym, ' /' )
289281 endif
290282
291- " TODO: replace `clojure_fuzzy_indent_patterns` with `clojure_indent_patterns`
283+ " TODO: replace `clojure_fuzzy_indent_patterns` with `clojure_indent_patterns`?
292284 for pat in s: Conf (' clojure_fuzzy_indent_patterns' , [])
293285 if sym = ~# pat | return base_indent + 1 | endif
294286 endfor
@@ -315,6 +307,7 @@ function! s:ListIndent(delim_pos)
315307 return base_indent + (indent_style == # ' traditional' || sym_match == 0 )
316308endfunction
317309
310+ " TODO: make this usable from other Clojure-like languages.
318311function ! s: ClojureIndent ()
319312 " Calculate and return indent to use based on the matching form.
320313 let [form, pos] = s: InsideForm (v: lnum )
0 commit comments