Skip to content

Commit f784bae

Browse files
committed
Handle nested quote blocks
Fixes #502
1 parent 6dd03f8 commit f784bae

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

autoload/elixir/indent.vim

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -379,7 +379,7 @@ endfunction
379379
" function, etc... so we need to first figure out what the innermost structure
380380
" is then forward execution to the proper handler
381381
function! elixir#indent#handle_inside_block(context)
382-
let start_pattern = '\C\%(\<with\>\|\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|{\|\[\|(\)'
382+
let start_pattern = '\C\%(\<with\>\|\<if\>\|\<case\>\|\<cond\>\|\<try\>\|\<receive\>\|\<fn\>\|\<quote\>\|{\|\[\|(\)'
383383
let end_pattern = '\C\%(\<end\>\|\]\|}\|)\)'
384384
" hack - handle do: better
385385
let block_info = searchpairpos(start_pattern, '', end_pattern, 'bnW', "line('.') == " . line('.') . " || elixir#indent#searchpair_back_skip() || getline(line('.')) =~ 'do:'", max([0, a:context.lnum - g:elixir_indent_max_lookbehind]))
@@ -394,6 +394,7 @@ function! elixir#indent#handle_inside_block(context)
394394
let never_match = ''
395395
let config = {
396396
\'f': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
397+
\'q': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
397398
\'c': {'aligned_clauses': s:keyword('end'), 'pattern_match_clauses': never_match},
398399
\'t': {'aligned_clauses': s:keyword('end\|catch\|rescue\|after\|else'), 'pattern_match_clauses': s:keyword('catch\|rescue\|else')},
399400
\'r': {'aligned_clauses': s:keyword('end\|after'), 'pattern_match_clauses': s:keyword('after')},

0 commit comments

Comments
 (0)