Skip to content

Commit 8c1c484

Browse files
nerdrewtpope
authored andcommitted
Fixed regex syntax so it works with ? : (ternary)
This commit fixes syntax highlighting for the following line: yo = 4 ? /quack#{3}/ : /quack/
1 parent e0a1d84 commit 8c1c484

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

syntax/ruby.vim

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -124,7 +124,7 @@ syn match rubyPredefinedConstant "\%(\%(\.\@<!\.\)\@<!\|::\)\_s*\zs\%(RUBY_VERSI
124124
"syn match rubyPredefinedConstant "\%(::\)\=\zs\%(NotImplementError\)\>"
125125

126126
" Normal Regular Expression
127-
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold
127+
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\%(^\|\<\%(and\|or\|while\|until\|unless\|if\|elsif\|when\|not\|then\|else\)\|[;\~=!|&(,[>?:]\)\s*\)\@<=/" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial keepend fold
128128
syn region rubyRegexp matchgroup=rubyRegexpDelimiter start="\%(\h\k*\s\+\)\@<=/[ \t=]\@!" end="/[iomxneus]*" skip="\\\\\|\\/" contains=@rubyRegexpSpecial fold
129129

130130
" Generalized Regular Expression

0 commit comments

Comments
 (0)