From b03eca332cb076643165a8d10aa91ee5c35660e3 Mon Sep 17 00:00:00 2001 From: Josh Bodah Date: Fri, 28 Dec 2018 09:31:24 -0500 Subject: [PATCH 1/2] add failing try/else spec --- spec/indent/try_spec.rb | 8 ++++++++ 1 file changed, 8 insertions(+) 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 From 15df985888ca43fbf218cc644ea50e41e2b2aeb1 Mon Sep 17 00:00:00 2001 From: Josh Bodah Date: Fri, 28 Dec 2018 09:33:16 -0500 Subject: [PATCH 2/2] add indent rules for try/else --- autoload/elixir/indent.vim | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) 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},