From 4071c094c69ba8ef716f8048cac8415fc7d96e26 Mon Sep 17 00:00:00 2001 From: Adam Stankiewicz Date: Tue, 9 Dec 2014 23:09:20 +0100 Subject: Update --- indent/elixir.vim | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) (limited to 'indent/elixir.vim') diff --git a/indent/elixir.vim b/indent/elixir.vim index 3563f44a..92b98460 100644 --- a/indent/elixir.vim +++ b/indent/elixir.vim @@ -12,7 +12,6 @@ setlocal nosmartindent setlocal indentexpr=GetElixirIndent() setlocal indentkeys+=0=end,0=else,0=match,0=elsif,0=catch,0=after,0=rescue -setlocal indentkeys+==-> if exists("*GetElixirIndent") finish @@ -68,10 +67,17 @@ function! GetElixirIndent() let ind += &sw endif + " if line starts with pipeline + " and last line contains pipeline(s) + " align them + if last_line =~ '|>.*$' && + \ current_line =~ s:pipeline + let ind = float2nr(match(last_line, '|>') / &sw) * &sw + " if line starts with pipeline " and last line is an attribution " indents pipeline in same level as attribution - if current_line =~ s:pipeline && + elseif current_line =~ s:pipeline && \ last_line =~ '^[^=]\+=.\+$' let b:old_ind = ind let ind = float2nr(matchend(last_line, '=\s*[^ ]') / &sw) * &sw -- cgit v1.2.3