Skip to content

Commit 5fa8650

Browse files
committed
Add some missing syntax groups to rubyNotTop
1 parent e79add9 commit 5fa8650

1 file changed

Lines changed: 12 additions & 5 deletions

File tree

syntax/ruby.vim

Lines changed: 12 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -66,7 +66,7 @@ com! -nargs=* SynFold call s:run_syntax_fold(<q-args>)
6666

6767
" }}}
6868

69-
syn cluster rubyNotTop contains=@rubyExtendedStringSpecial,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyTodo,rubyModuleName,rubyClassName,rubySymbolDelimiter,rubyEncoding
69+
syn cluster rubyNotTop contains=@rubyCommentNotTop,@rubyStringNotTop,@rubyRegexpSpecial,@rubyDeclaration,rubyConditional,rubyExceptional,rubyMethodExceptional,rubyModuleName,rubyClassName,rubySymbolDelimiter
7070

7171
" Whitespace Errors {{{1
7272
if exists("ruby_space_errors")
@@ -111,6 +111,11 @@ syn region rubyNestedCurlyBraces start="{" skip="\\\\\|\\}" matchgroup=ruby
111111
syn region rubyNestedAngleBrackets start="<" skip="\\\\\|\\>" matchgroup=rubyString end=">" transparent contained
112112
syn region rubyNestedSquareBrackets start="\[" skip="\\\\\|\\\]" matchgroup=rubyString end="\]" transparent contained
113113

114+
syn cluster rubySingleCharEscape contains=rubyBackslashEscape,rubyQuoteEscape,rubySpaceEscape,rubyParenthesesEscape,rubyCurlyBracesEscape,rubyAngleBracketsEscape,rubySquareBracketsEscape
115+
syn cluster rubyNestedBrackets contains=rubyNested.\+
116+
syn cluster rubyStringSpecial contains=rubyInterpolation,rubyStringEscape
117+
syn cluster rubyStringNotTop contains=@rubyStringSpecial,@rubyNestedBrackets,@rubySingleCharEscape
118+
114119
" Regular Expression Metacharacters {{{1
115120
syn region rubyRegexpComment matchgroup=rubyRegexpSpecial start="(?#" skip="\\\\\|\\)" end=")" contained
116121
syn region rubyRegexpParens matchgroup=rubyRegexpSpecial start="(\(?:\|?<\=[=!]\|?>\|?<[a-z_]\w*>\|?[imx]*-[imx]*:\=\|\%(?#\)\@!\)" skip="\\\\\|\\)" end=")" contained transparent contains=@rubyRegexpSpecial
@@ -132,9 +137,7 @@ syn match rubyRegexpSpecial "\\k'\%([a-z_]\w*\|-\=\d\+\)\%([+-]\d\+\)\='" con
132137
syn match rubyRegexpSpecial "\\g<\%([a-z_]\w*\|-\=\d\+\)>" contained display
133138
syn match rubyRegexpSpecial "\\g'\%([a-z_]\w*\|-\=\d\+\)'" contained display
134139

135-
syn cluster rubyStringSpecial contains=rubyInterpolation,rubyStringEscape
136-
syn cluster rubyExtendedStringSpecial contains=@rubyStringSpecial,rubyNestedParentheses,rubyNestedCurlyBraces,rubyNestedAngleBrackets,rubyNestedSquareBrackets
137-
syn cluster rubyRegexpSpecial contains=rubyInterpolation,rubyStringEscape,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment,rubyRegexpIntersection
140+
syn cluster rubyRegexpSpecial contains=@rubyStringSpecial,rubyRegexpSpecial,rubyRegexpEscape,rubyRegexpBrackets,rubyRegexpCharClass,rubyRegexpDot,rubyRegexpQuantifier,rubyRegexpAnchor,rubyRegexpParens,rubyRegexpComment,rubyRegexpIntersection
138141

139142
" Numbers {{{1
140143
syn match rubyInteger "\%(\%(\w\|[]})\"']\s*\)\@<!-\)\=\<0[xX]\x\+\%(_\x\+\)*r\=i\=\>" display
@@ -367,7 +370,11 @@ syn keyword rubyTodo FIXME NOTE TODO OPTIMIZE HACK REVIEW XXX todo contain
367370
syn match rubyEncoding "[[:alnum:]-]\+" contained display
368371
syn match rubyMagicComment "\c\%<3l#\s*\zs\%(coding\|encoding\):" contained nextgroup=rubyEncoding skipwhite
369372
syn match rubyMagicComment "\c\%<10l#\s*\zs\%(frozen_string_literal\|warn_indent\|warn_past_scope\):" contained nextgroup=rubyBoolean skipwhite
370-
syn match rubyComment "#.*" contains=rubySharpBang,rubySpaceError,rubyTodo,rubyMagicComment,@Spell
373+
syn match rubyComment "#.*" contains=@rubyCommentSpecial,rubySpaceError,@Spell
374+
375+
syn cluster rubyCommentSpecial contains=rubySharpBang,rubyTodo,rubyMagicComment
376+
syn cluster rubyCommentNotTop contains=@rubyCommentSpecial,rubyEncoding
377+
371378
if !exists("ruby_no_comment_fold") && s:foldable('#')
372379
syn region rubyMultilineComment start="^\s*#.*\n\%(^\s*#\)\@=" end="^\s*#.*\n\%(^\s*#\)\@!" contains=rubyComment transparent fold keepend
373380
syn region rubyDocumentation start="^=begin\ze\%(\s.*\)\=$" end="^=end\%(\s.*\)\=$" contains=rubySpaceError,rubyTodo,@Spell fold

0 commit comments

Comments
 (0)