diff options
author | Adam Stankiewicz <sheerun@sher.pl> | 2014-01-09 11:59:09 +0100 |
---|---|---|
committer | Adam Stankiewicz <sheerun@sher.pl> | 2014-01-09 11:59:09 +0100 |
commit | f211f02d1e53dbb4eada17e999eba81bccaf1fb2 (patch) | |
tree | 0c26fd0f916643af27e56fab71d3fe8dc58e4231 /indent/clojure.vim | |
parent | e45b23b6ee6e3b00ba4c7111f0c703f93fea9123 (diff) | |
download | vim-polyglot-f211f02d1e53dbb4eada17e999eba81bccaf1fb2.tar.gz vim-polyglot-f211f02d1e53dbb4eada17e999eba81bccaf1fb2.zip |
Update
Diffstat (limited to 'indent/clojure.vim')
-rw-r--r-- | indent/clojure.vim | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/indent/clojure.vim b/indent/clojure.vim index fd9ebb69..a92e273c 100644 --- a/indent/clojure.vim +++ b/indent/clojure.vim @@ -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 =~ '\<' . w . '\>' return 1 endif @@ -273,7 +278,7 @@ 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 . '\>' return paren[1] + &shiftwidth - 1 |