summaryrefslogtreecommitdiffstats
path: root/indent/eelixir.vim
diff options
context:
space:
mode:
authorAdam Stankiewicz <sheerun@sher.pl>2016-09-11 13:24:17 +0200
committerAdam Stankiewicz <sheerun@sher.pl>2016-09-11 13:24:17 +0200
commit0244e228faf6ee71750cbca3bdcd18411a927d22 (patch)
treea72e5c9839ea593f6edc23f7f0e637e0a4a89413 /indent/eelixir.vim
parentab61d2ac8eafc9c10097577736602da48ec568ca (diff)
downloadvim-polyglot-0244e228faf6ee71750cbca3bdcd18411a927d22.tar.gz
vim-polyglot-0244e228faf6ee71750cbca3bdcd18411a927d22.zip
Update
Diffstat (limited to 'indent/eelixir.vim')
-rw-r--r--indent/eelixir.vim19
1 files changed, 12 insertions, 7 deletions
diff --git a/indent/eelixir.vim b/indent/eelixir.vim
index d9538425..b80edc98 100644
--- a/indent/eelixir.vim
+++ b/indent/eelixir.vim
@@ -8,6 +8,9 @@ runtime! indent/elixir.vim
unlet! b:did_indent
setlocal indentexpr=
+let s:cpo_save = &cpo
+set cpo&vim
+
if exists("b:eelixir_subtype")
exe "runtime! indent/".b:eelixir_subtype.".vim"
else
@@ -53,19 +56,21 @@ function! GetEelixirIndent(...)
let line = getline(lnum)
let cline = getline(v:lnum)
if cline =~# '^\s*<%\s*\%(end\|else\|elsif\|catch\|after\|rescue\)\>.*%>'
- let ind = ind - &sw
+ let ind -= &sw
elseif line =~# '\S\s*<%\s*end\s*%>'
- let ind = ind - &sw
+ let ind -= &sw
endif
- if line =~# '<%[=%]\=\s*.*\<do\s*%>'
- let ind = ind + &sw
- elseif line =~# '<%\s*\%(else\|elsif\|catch\|after\|rescue\)\>.*%>'
- let ind = ind + &sw
+ if line =~# '<%[=%]\=\s*.*\(\<do\|->\)\s*%>' ||
+ \ line =~# '<%\s*\%(else\|elsif\|catch\|after\|rescue\)\>.*%>'
+ let ind += &sw
endif
if cline =~# '^\s*%>\s*$'
- let ind = ind - &sw
+ let ind -= &sw
endif
return ind
endfunction
+let &cpo = s:cpo_save
+unlet s:cpo_save
+
endif