summaryrefslogtreecommitdiffstats
path: root/runtime/indent/clojure.vim
diff options
context:
space:
mode:
authorBram Moolenaar <Bram@vim.org>2014-03-27 22:30:07 +0100
committerBram Moolenaar <Bram@vim.org>2014-03-27 22:30:07 +0100
commit76f3b1ad77188182e3c924d1e70269c171b9ecc5 (patch)
tree7532f2594754ac586ce47a062d6f03618493a19f /runtime/indent/clojure.vim
parent73b044dca94c8d427144b920c12fe5c47007a6f6 (diff)
Update runtime files.
Diffstat (limited to 'runtime/indent/clojure.vim')
-rw-r--r--runtime/indent/clojure.vim17
1 files changed, 11 insertions, 6 deletions
diff --git a/runtime/indent/clojure.vim b/runtime/indent/clojure.vim
index 64f1333643..476ac1de1c 100644
--- a/runtime/indent/clojure.vim
+++ b/runtime/indent/clojure.vim
@@ -6,7 +6,7 @@
" Maintainer: Sung Pae <self@sungpae.com>
" URL: https://github.com/guns/vim-clojure-static
" License: Same as Vim
-" Last Change: 16 February 2014
+" Last Change: 27 March 2014
" TODO: Indenting after multibyte characters is broken:
" (let [Δ (if foo
@@ -70,7 +70,7 @@ if exists("*searchpairpos")
endfunction
function! s:IsParen()
- return s:CurrentChar() =~ '\v[\(\)\[\]\{\}]' &&
+ return s:CurrentChar() =~# '\v[\(\)\[\]\{\}]' &&
\ s:SynIdName() !~? '\vstring|regex|comment|character'
endfunction
@@ -82,7 +82,7 @@ if exists("*searchpairpos")
\ ? a:patterns
\ : map(split(a:patterns, ','), '"^" . v:val . "$"')
for pat in list
- if a:string =~ pat | return 1 | endif
+ if a:string =~# pat | return 1 | endif
endfor
endfunction
@@ -148,6 +148,10 @@ if exists("*searchpairpos")
return val
endfunction
+ function! s:StripNamespaceAndMacroChars(word)
+ return substitute(a:word, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '')
+ endfunction
+
function! s:ClojureIsMethodSpecialCaseWorker(position)
" Find the next enclosing form.
call search('\S', 'Wb')
@@ -167,7 +171,8 @@ if exists("*searchpairpos")
call cursor(nextParen)
call search('\S', 'W')
- if g:clojure_special_indent_words =~ '\<' . s:CurrentWord() . '\>'
+ let w = s:StripNamespaceAndMacroChars(s:CurrentWord())
+ if g:clojure_special_indent_words =~# '\V\<' . w . '\>'
return 1
endif
@@ -273,9 +278,9 @@ if exists("*searchpairpos")
" metacharacters.
"
" e.g. clojure.core/defn and #'defn should both indent like defn.
- let ww = substitute(w, "\\v%(.*/|[#'`~@^,]*)(.*)", '\1', '')
+ let ww = s:StripNamespaceAndMacroChars(w)
- if &lispwords =~ '\V\<' . ww . '\>'
+ if &lispwords =~# '\V\<' . ww . '\>'
return paren[1] + &shiftwidth - 1
endif