Skip to content

Commit f8b55e9

Browse files
committed
Inline and refactor simple boolean functions
1 parent 679b666 commit f8b55e9

File tree

1 file changed

+3
-28
lines changed

1 file changed

+3
-28
lines changed

indent/clojure.vim

+3-28
Original file line numberDiff line numberDiff line change
@@ -190,32 +190,7 @@ if exists("*searchpairpos")
190190
" Check if form is a reader conditional, that is, it is prefixed by #?
191191
" or @#?
192192
function! s:is_reader_conditional_special_case(position)
193-
if getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
194-
return 1
195-
endif
196-
197-
return 0
198-
endfunction
199-
200-
" Check if keyword is an anonymous function, prefixed by #(, or a set,
201-
" prefixed by #{
202-
function! s:is_anonymous_function_or_set(word)
203-
if a:word[0:1] == "#("
204-
return 1
205-
elseif a:word[0:1] == "#{"
206-
return 1
207-
endif
208-
209-
return 0
210-
endfunction
211-
212-
" Check if keyword is ignored, that is, prefixed by #_
213-
function! s:is_ignored(word)
214-
if a:word[0:1] == "#_"
215-
return 1
216-
endif
217-
218-
return 0
193+
return getline(a:position[0])[a:position[1] - 3 : a:position[1] - 2] == "#?"
219194
endfunction
220195

221196
" Returns 1 for opening brackets, -1 for _anything else_.
@@ -318,9 +293,9 @@ if exists("*searchpairpos")
318293
" (minus one if g:clojure_align_subforms = 1), or if it is
319294
" ignored, in which case we use the ( position for indent.
320295
if w[0] == "#"
321-
if s:is_anonymous_function_or_set(w)
296+
if w[1] == '(' || w[1] == '{'
322297
return [paren[0], paren[1] + (g:clojure_align_subforms ? 0 : &shiftwidth - 1)]
323-
elseif s:is_ignored(w)
298+
elseif w[1] == '_'
324299
return paren
325300
endif
326301
endif

0 commit comments

Comments
 (0)