File tree Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Expand file tree Collapse file tree 1 file changed +15
-6
lines changed Original file line number Diff line number Diff line change @@ -46,8 +46,10 @@ function! s:Conf(opt, default)
4646endfunction
4747
4848function ! s: ShouldAlignMultiLineStrings ()
49- " TODO: third option "-1" to default to "no indent", like traditional
50- " lisps?
49+ " Possible Values: (default is 0)
50+ " -1: Indent of 0, along left edge, like traditional Lisps.
51+ " 0: Indent in alignment with string start delimiter.
52+ " 1: Indent in alignment with end of the string start delimiter.
5153 return s: Conf (' clojure_align_multiline_strings' , 0 )
5254endfunction
5355
@@ -118,10 +120,17 @@ function! s:GetClojureIndent()
118120 if m == # ' i' || (m == # ' n' && ! (v: operator == # ' =' && state () = ~# ' o' ))
119121 " If in insert mode, or (in normal mode and last
120122 " operator is not "=" and is not currently active.
121- let l: indent = (s: ShouldAlignMultiLineStrings ()
122- \ ? 0
123- \ : (formtype == # ' reg' ? 2 : 1 ))
124- return coord[1 ] - l: indent
123+ let rule = s: ShouldAlignMultiLineStrings ()
124+ if rule == -1
125+ " No indent.
126+ return 0
127+ elseif rule == 1
128+ " Align with start of delimiter.
129+ return coord[1 ]
130+ else
131+ " Align with end of delimiter.
132+ return coord[1 ] - (formtype == # ' reg' ? 2 : 1 )
133+ endif
125134 endif
126135 endif
127136
You can’t perform that action at this time.
0 commit comments