File tree 1 file changed +15
-6
lines changed
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)
46
46
endfunction
47
47
48
48
function ! 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.
51
53
return s: Conf (' clojure_align_multiline_strings' , 0 )
52
54
endfunction
53
55
@@ -118,10 +120,17 @@ function! s:GetClojureIndent()
118
120
if m == # ' i' || (m == # ' n' && ! (v: operator == # ' =' && state () = ~# ' o' ))
119
121
" If in insert mode, or (in normal mode and last
120
122
" 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
125
134
endif
126
135
endif
127
136
You can’t perform that action at this time.
0 commit comments