Skip to content

Commit

Permalink
Remove "/" from list of allowed characters before if
Browse files Browse the repository at this point in the history
This means that dividing a number by the results of an if-clause won't
work right, but at least regular expressions will.

Discussed in #254
  • Loading branch information
AndrewRadev committed Apr 30, 2015
1 parent 70ef0de commit ef2deea
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion syntax/ruby.vim
Original file line number Diff line number Diff line change
Expand Up @@ -242,7 +242,7 @@ if !exists("b:ruby_no_expensive") && !exists("ruby_no_expensive")
" statements without 'do'
syn region rubyBlockExpression matchgroup=rubyControl start="\<begin\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
syn region rubyCaseExpression matchgroup=rubyConditional start="\<case\>" end="\<end\>" contains=ALLBUT,@rubyNotTop fold
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*/%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold
syn region rubyConditionalExpression matchgroup=rubyConditional start="\%(\%(^\|\.\.\.\=\|[{:,;([<>~\*%&^|+=-]\|\%(\<[_[:lower:]][_[:alnum:]]*\)\@<![?!]\)\s*\)\@<=\%(if\|unless\)\>" end="\%(\%(\%(\.\@<!\.\)\|::\)\s*\)\@<!\<end\>" contains=ALLBUT,@rubyNotTop fold

syn match rubyConditional "\<\%(then\|else\|when\)\>[?!]\@!" contained containedin=rubyCaseExpression
syn match rubyConditional "\<\%(then\|else\|elsif\)\>[?!]\@!" contained containedin=rubyConditionalExpression
Expand Down

0 comments on commit ef2deea

Please sign in to comment.