Permalink
Browse files

Rewrite end_start_regex a bit more

The two major branches of the regex are now unified with the intention
of having it work in a more general case.
  • Loading branch information...
1 parent 4d2d7fa commit 00ecb051c99b730003cbdab75c05010db702def8 @AndrewRadev AndrewRadev committed Mar 20, 2012
Showing with 3 additions and 4 deletions.
  1. +3 −4 indent/ruby.vim
View
@@ -63,10 +63,9 @@ let s:ruby_deindent_keywords =
" Regex that defines the start-match for the 'end' keyword.
"let s:end_start_regex = '\%(^\|[^.]\)\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\|do\)\>'
" TODO: the do here should be restricted somewhat (only at end of line)?
-let s:end_start_regex = '\%(^\|[{|;]\)\s*\zs\<\%(module\|class\|def\|if\|for' .
- \ '\|while\|until\|case\|unless\|begin\):\@!\>' .
- \ '\|\%([=,*/%+-]\|<<\|>>\|:\s\)\s*\zs' .
- \ '\<\%(if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
+let s:end_start_regex =
+ \ '\%(^\s*\|[=,*/%+\-|;{]\|<<\|>>\|:\s\)\s*\zs' .
+ \ '\<\%(module\|class\|def\|if\|for\|while\|until\|case\|unless\|begin\):\@!\>' .
\ '\|\<do:\@!\>'
" Regex that defines the middle-match for the 'end' keyword.

0 comments on commit 00ecb05

Please sign in to comment.