Skip to content

Commit caef0c5

Browse files
committed
Improve accuracy of multiline string detection for indentation
1 parent bf4cf3d commit caef0c5

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

indent/clojure.vim

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,15 +157,15 @@ function! s:InsideForm(lnum)
157157
endif
158158
endfor
159159

160-
if ! empty(tokens) && has_key(s:pairs, tokens[0][0])
160+
if ! empty(tokens) && has_key(s:pairs, tokens[0][0]) && ! in_string
161161
" Match found!
162162
return tokens[0]
163163
endif
164164

165165
let lnum -= 1
166166
endwhile
167167

168-
if ! empty(tokens) && tokens[0][0] ==# '"'
168+
if (in_string && first_string_pos != []) || (! empty(tokens) && tokens[0][0] ==# '"')
169169
" Must have been in a multi-line string or regular expression
170170
" as the string was never closed.
171171
return first_string_pos

0 commit comments

Comments
 (0)