Skip to content

Commit

Permalink
More comments on parsing |(a, b)|
Browse files Browse the repository at this point in the history
  • Loading branch information
AndrewRadev committed Apr 21, 2012
1 parent 05b34b6 commit 30c6aee
Showing 1 changed file with 8 additions and 0 deletions.
8 changes: 8 additions & 0 deletions indent/ruby.vim
Expand Up @@ -92,6 +92,14 @@ let s:continuation_regex =
let s:bracket_continuation_regex = '\%([({[]\)\s*\%(#.*\)\=$'

" Regex that defines blocks.
"
" Note that there's a slight problem with this regex and s:continuation_regex.
" Code like this will be matched by both:
"
" method_call do |(a, b)|
"
" The reason is that the pipe matches a hanging "|" operator.
"
let s:block_regex =
\ '\%(\<do:\@!\>\|{\)\s*\%(|\s*(\=\%([*@&]\=\h\w*,\=\s*\)\%(,\s*(\=\s*[*@&]\=\h\w*)\=\)*|\)\=\s*\%(#.*\)\=$'

Expand Down

0 comments on commit 30c6aee

Please sign in to comment.