From f211f02d1e53dbb4eada17e999eba81bccaf1fb2 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Thu, 9 Jan 2014 11:59:09 +0100 Subject: Update --- indent/clojure.vim | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'indent/clojure.vim') 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 -- cgit v1.2.3