diff --git a/autoload/elixir/indent.vim b/autoload/elixir/indent.vim index 88dbd789..f9fa9ee2 100644 --- a/autoload/elixir/indent.vim +++ b/autoload/elixir/indent.vim @@ -265,7 +265,7 @@ function! elixir#indent#handle_inside_block(context) let config = { \'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, \'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match}, - \'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after'), 'pattern_match_clauses': s:keyword('catch\|rescue')}, + \'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after\|else'), 'pattern_match_clauses': s:keyword('catch\|rescue\|else')}, \'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')}, \'i': {'aligned_clauses': s:keyword('end\|else'), 'pattern_match_clauses': never_match}, \'[': {'aligned_clauses': ']', 'pattern_match_clauses': never_match}, diff --git a/spec/indent/try_spec.rb b/spec/indent/try_spec.rb index 3e9ff740..08095f58 100644 --- a/spec/indent/try_spec.rb +++ b/spec/indent/try_spec.rb @@ -30,4 +30,12 @@ end end EOF + + i <<~EOF + try do + foo() + else + value -> value + end + EOF end